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 }
public void SutIsSpecimenBuilder() { // Fixture setup // Exercise system var sut = new NumericSequenceGenerator(); // Verify outcome Assert.IsAssignableFrom<ISpecimenBuilder>(sut); // Teardown }
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 }
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 }
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 }
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 }