Exemplo n.º 1
0
 public void CreateWillReturnFalseOnSecondCall()
 {
     // Fixture setup
     BooleanSwitch sut = new BooleanSwitch();
     sut.Create();
     // Exercise system
     bool result = sut.Create();
     // Verify outcome
     Assert.False(result, "CreateAnonymous called an even number of times");
     // Teardown
 }
 public void CreateWithNullRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var sut = new BooleanSwitch();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
Exemplo n.º 3
0
 public void CreateWithBooleanRequestWillReturnCorrectResultOnFourthCall()
 {
     // Fixture setup
     var booleanRequest = typeof(bool);
     var sut = new BooleanSwitch();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     sut.Create(booleanRequest, dummyContainer);
     sut.Create(booleanRequest, dummyContainer);
     sut.Create(booleanRequest, dummyContainer);
     var result = sut.Create(booleanRequest, dummyContainer);
     // Verify outcome
     Assert.Equal(false, result);
     // Teardown
 }
Exemplo n.º 4
0
 public void CreateWithNonBooleanRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var nonBooleanRequest = new object();
     var sut = new BooleanSwitch();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(nonBooleanRequest, dummyContainer);
     // Verify outcome
     var expectedResult = new NoSpecimen(nonBooleanRequest);
     Assert.Equal(expectedResult, result);
     // Teardown
 }
Exemplo n.º 5
0
 public void CreateWithNullContainerDoesNotThrow()
 {
     // Fixture setup
     var sut = new BooleanSwitch();
     // Exercise system
     var dummyRequest = new object();
     sut.Create(dummyRequest, null);
     // Verify outcome (no exception indicates success)
     // Teardown
 }