-
-
Save MattHoneycutt/1529690 to your computer and use it in GitHub Desktop.
SpecFor Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Given(typeof(the_entity_is_available))] | |
public class When_entity_is_on_hold : SpecsFor<Entity> | |
{ | |
public When_entity_is_on_hold(Type[] contexts) : base(contexts) { } | |
protected override void InitializeClassUnderTest() | |
{ | |
SUT = new Entity("test"); | |
} | |
protected override void When() | |
{ | |
Console.WriteLine("When condition met "); | |
base.When(); | |
} | |
[Test] | |
public void then_can_not_pay() | |
{ | |
Console.WriteLine("Okay, Can not pay"); | |
} | |
} | |
public class the_entity_is_available : IContext<Entity> | |
{ | |
public void Initialize(ITestState<Entity> state) | |
{ | |
Console.WriteLine("Here's my test class: " + state.SUT); | |
Console.WriteLine("Transaction created !"); | |
} | |
} | |
public class Entity | |
{ | |
private string _name; | |
private Entity() | |
{ | |
_name = ""; | |
} | |
public Entity(string name) | |
{ | |
_name = name; | |
} | |
public string Name { get { return _name; } } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment