Created
February 24, 2011 23:16
-
-
Save agileguy/843100 to your computer and use it in GitHub Desktop.
The Essence of David's Original Tests
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
| 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