public void CreateWithNullContextDoesNotThrow() { // Fixture setup var sut = new CharSequenceGenerator(); var dummyRequest = new object(); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Create(dummyRequest, null)); // Teardown }
public void CreateWithNullRequestReturnsCorrectResult() { // Fixture setup var sut = new CharSequenceGenerator(); // Exercise system var dummyContext = new DelegatingSpecimenContext(); var result = sut.Create(null, dummyContext); // Verify outcome Assert.Equal(new NoSpecimen(), result); // Teardown }
public void CreateWithCharRequestReturnsCorrectResult() { // Fixture setup var charRequest = typeof(char); var sut = new CharSequenceGenerator(); // Exercise system var dummyContext = new DelegatingSpecimenContext(); var result = sut.Create(charRequest, dummyContext); // Verify outcome Assert.Equal('!', result); // Teardown }
public void CreateWithNonCharRequestReturnsCorrectResult() { // Fixture setup var dummyRequest = new object(); var sut = new CharSequenceGenerator(); // Exercise system var dummyContext = new DelegatingSpecimenContext(); var result = sut.Create(dummyRequest, dummyContext); // Verify outcome var expectedResult = new NoSpecimen(dummyRequest); Assert.Equal(expectedResult, result); // Teardown }
public void CreateWithCharRequestReturnsCorrectResultOnSecondCall() { // Fixture setup var charRequest = typeof(char); var sut = new CharSequenceGenerator(); // Exercise system var dummyContext = new DelegatingSpecimenContext(); var result = Enumerable.Range(1, 2) .Select(i => sut.Create(charRequest, dummyContext)) .Cast<char>(); // Verify outcome char c = ' '; IEnumerable<char> expectedResult = Enumerable.Range(1, 2).Select(i => ++c); Assert.True(expectedResult.SequenceEqual(result)); // Teardown }
public void CreateWithCharReturnsCorrectResultWhenRunOutOfChars() { // Fixture setup var charRequest = typeof(char); var sut = new CharSequenceGenerator(); // Exercise system var dummyContext = new DelegatingSpecimenContext(); var result = Enumerable.Range(1, 95) .Select(i => sut.Create(charRequest, dummyContext)) .Cast<char>() .Last(); // Verify outcome char expectedResult = '!'; Assert.Equal(expectedResult, result); // Teardown }