Esempio n. 1
0
 public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     // Exercise system
     var sut = new GuidGenerator();
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
Esempio n. 2
0
 public void CreateWithNullRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var sut = new GuidGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
Esempio n. 3
0
        public void CreateWithNonGuidRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var nonGuidRequest = new object();
            var sut = new GuidGenerator();
            // Exercise system
            var dummyContext = new DelegatingSpecimenContext();
            var result = sut.Create(nonGuidRequest, dummyContext);
            // Verify outcome
#pragma warning disable 618
            var expectedResult = new NoSpecimen(nonGuidRequest);
#pragma warning restore 618
            Assert.Equal(expectedResult, result);
            // Teardown
        }
Esempio n. 4
0
 public void CreateWithNullContextDoesNotThrow()
 {
     // Fixture setup
     var sut = new GuidGenerator();
     // Exercise system
     var dummyRequest = new object();
     sut.Create(dummyRequest, null);
     // Verify outcome (no exception indicates success)
     // Teardown
 }
Esempio n. 5
0
        public void CreateWithGuidRequestTwiceWillReturnDifferentResults()
        {
            // Fixture setup
            var sut = new GuidGenerator();

            var guidRequest = typeof(Guid);
            var dummyContext = new DelegatingSpecimenContext();
            var unexpectedResult = sut.Create(guidRequest, dummyContext);
            // Exercise system
            var result = sut.Create(guidRequest, dummyContext);
            // Verify outcome
            Assert.NotEqual(unexpectedResult, result);
            // Teardown
        }