public void CreateWithNullContextDoesNotThrow()
 {
     // Fixture setup
     var sut = new CurrentDateTimeGenerator();
     // Exercise system and verify outcome
     var dummyRequest = new object();
     Assert.DoesNotThrow(() => sut.Create(dummyRequest, null));
     // Teardown
 }
 public void CreateWithNullRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var sut = new CurrentDateTimeGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
 public void CreateWithDateTimeRequestReturnsCorrectResult()
 {
     // Fixture setup
     var before = DateTime.Now;
     var dateTimeRequest = typeof(DateTime);
     var sut = new CurrentDateTimeGenerator();
     // Exercise system
     var dummyContext = new DelegatingSpecimenContext();
     var result = sut.Create(dateTimeRequest, dummyContext);
     // Verify outcome
     var after = DateTime.Now;
     var dt = Assert.IsAssignableFrom<DateTime>(result);
     Assert.True(before <= dt && dt <= after);
     // Teardown
 }
        public void CreateWithNonDateTimeRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var nonDateTimeRequest = new object();
            var sut = new CurrentDateTimeGenerator();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result = sut.Create(nonDateTimeRequest, dummyContainer);
            // Verify outcome
#pragma warning disable 618
            var expectedResult = new NoSpecimen(nonDateTimeRequest);
#pragma warning restore 618
            Assert.Equal(expectedResult, result);
            // Teardown
        }