コード例 #1
0
 public void CreateWithNullContextDoesNotThrow()
 {
     // Fixture setup
     var sut = new NumericSequenceGenerator();
     // Exercise system and verify outcome
     var dummyRequest = new object();
     Assert.DoesNotThrow(() => sut.Create(dummyRequest, null));
     // Teardown
 }
コード例 #2
0
 public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     // Exercise system
     var sut = new NumericSequenceGenerator();
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
コード例 #3
0
 public void CreateWithNullRequestReturnsNoSpecimen()
 {
     // Fixture setup
     var sut = new NumericSequenceGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
コード例 #4
0
 public void CreateWithNonNumericTypeRequestReturnsNoSpecimen(Type request)
 {
     // Fixture setup
     var sut = new NumericSequenceGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(request, dummyContainer);
     // Verify outcome
     var expectedResult = new NoSpecimen(request);
     Assert.Equal(expectedResult, result);
     // Teardown
 }
コード例 #5
0
 public void CreateWithNumericTypeRequestReturnsCorrectValue(Type request)
 {
     // Fixture setup
     var sut = new NumericSequenceGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(request, dummyContainer);
     // Verify outcome
     Assert.IsType(request, result);
     // Teardown
 }
コード例 #6
0
 public void CreateWith128SByteRequestsReturnsSByteSpecimens()
 {
     // Fixture setup
     var sequence = Enumerable.Range(0, SByte.MaxValue + 1);
     var request = typeof(SByte);
     var sut = new NumericSequenceGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sequence.Select(i => sut.Create(request, dummyContainer));
     // Verify outcome
     Assert.True(result.All(i => i.GetType() == request));
     // Teardown
 }