public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     // Exercise system
     var sut = new StringGenerator(() => new object());
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
 public void CreateWithNullContainerWillNotThrow()
 {
     // Fixture setup
     var sut = new StringGenerator(() => string.Empty);
     // Exercise system
     var dummyRequest = new object();
     sut.Create(dummyRequest, null);
     // Verify outcome (no exception indicates success)
     // Teardown
 }
 public void FactoryIsCorrect()
 {
     // Fixture setup
     Func<object> expectedFactory = () => new object();
     var sut = new StringGenerator(expectedFactory);
     // Exercise system
     Func<object> result = sut.Factory;
     // Verify outcome
     Assert.Equal(expectedFactory, result);
     // Teardown
 }
 public void CreateFromNullRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var sut = new StringGenerator(() => new object());
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     var expectedResult = new NoSpecimen();
     Assert.Equal(expectedResult, result);
     // Teardown
 }
        public void CreateFromNonStringRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var sut = new StringGenerator(() => string.Empty);
            var nonStringRequest = new object();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result = sut.Create(nonStringRequest, dummyContainer);
            // Verify outcome
#pragma warning disable 618
            var expectedResult = new NoSpecimen(nonStringRequest);
#pragma warning restore 618
            Assert.Equal(expectedResult, result);
            // Teardown
        }
        public void CreateFromStringRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var specimen = 1;
            var expectedResult = specimen.ToString();

            var sut = new StringGenerator(() => specimen);
            var stringRequest = typeof(string);
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result = sut.Create(stringRequest, dummyContainer);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }
        public void CreateFromStringRequestWhenFactoryReturnsNullWillReturnCorrectResult()
        {
            // Fixture setup
            var sut = new StringGenerator(() => null);
            var stringRequest = typeof(string);
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result = sut.Create(stringRequest, dummyContainer);
            // Verify outcome
#pragma warning disable 618
            var expectedResult = new NoSpecimen(stringRequest);
#pragma warning restore 618
            Assert.Equal(expectedResult, result);
            // Teardown
        }