Skip to content

Instantly share code, notes, and snippets.

@agileguy
Created February 24, 2011 23:16
Show Gist options
  • Select an option

  • Save agileguy/843100 to your computer and use it in GitHub Desktop.

Select an option

Save agileguy/843100 to your computer and use it in GitHub Desktop.
The Essence of David's Original Tests
namespace sandbox
{
using Specify;
using Specify.Assertions;
public enum TestEnum
{
Zero = 0,
One = 1
}
public class zero_cast_to_enum
{
Given _a_field =()=> {};
When _set_to_zero_cast_to_enum =()=> _zeroEnum = (TestEnum)0;
Then _equals_zero_when_cast_to_int =()=>
((int)_zeroEnum).Equals(0).ShouldBe(true);
private static TestEnum _zeroEnum;
}
public class two_cast_to_enum
{
Given _a_field =()=> { };
When _set_to_two_cast_to_enum =()=> _field = (TestEnum)2;
Then _equals_two_when_cast_to_int =()=>
((int)_field).Equals(2).ShouldBe(true);
private static TestEnum _field;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment