Created
December 28, 2011 17:35
-
-
Save jalchr/1528815 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 Shared().CreateEntity(); | |
} | |
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) | |
{ | |
state.GetMockFor<Entity>(); | |
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