Created
December 16, 2011 16:02
-
-
Save rasmuskl/1486597 to your computer and use it in GitHub Desktop.
Autofixture question
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
| public class TestClass | |
| { | |
| public void Test1() | |
| { | |
| var fixture = new Fixture(); | |
| // This doesn't let me pass 42? | |
| sut.Freeze<int>("importantNumber"); | |
| var sut = fixture.CreateAnonymous<ToBeInstantiated>(); | |
| sut.Magic.ShouldBeTrue(); | |
| } | |
| public class ToBeInstantiated | |
| { | |
| public class ToBeInstantiated(int someNumber, int importantNumber) | |
| { | |
| // Magic happens depending on value of importantNumber | |
| Magic = importantNumber == 42; | |
| } | |
| public bool Magic { get; private set; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment