예제 #1
0
        public void CreateOnSpecimenBuilderReturnsCorrectResult()
        {
            // Arrange
            var expected = new DateTime(2012, 11, 20, 9, 45, 51);
            var builder  = new DelegatingSpecimenBuilder();

            builder.OnCreate = (r, c) =>
            {
                Assert.NotNull(c);
                Assert.Equal(
                    new SeededRequest(typeof(DateTime), default(DateTime)),
                    r);
                return(expected);
            };
            // Act
            DateTime actual = builder.Create <DateTime>();

            // Assert
            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void CreateOnSpecimenBuilderReturnsCorrectResult()
        {
            // Fixture setup
            var expected = new DateTime(2012, 11, 20, 9, 45, 51);
            var builder  = new DelegatingSpecimenBuilder();

            builder.OnCreate = (r, c) =>
            {
                Assert.NotNull(c);
                Assert.Equal(
                    new SeededRequest(typeof(DateTime), default(DateTime)),
                    r);
                return(expected);
            };
            // Exercise system
            DateTime actual = builder.Create <DateTime>();

            // Verify outcome
            Assert.Equal(expected, actual);
            // Teardown
        }
예제 #3
0
 public void CreateWithSeedOnSpecimenBuilderReturnsCorrectResult()
 {
     // Fixture setup
     var seed = new Version(2, 15);
     var expected = new Version(3, 0);
     var builder = new DelegatingSpecimenBuilder();
     builder.OnCreate = (r, c) =>
     {
         Assert.NotNull(c);
         Assert.Equal(
             new SeededRequest(typeof(Version), seed),
             r);
         return expected;
     };
     // Exercise system
     Version actual = builder.Create<Version>(seed);
     // Verify outcome
     Assert.Equal(expected, actual);
     // Teardown
 }
예제 #4
0
 public void CreateOnSpecimenBuilderReturnsCorrectResult()
 {
     // Fixture setup
     var expected = new DateTime(2012, 11, 20, 9, 45, 51);
     var builder = new DelegatingSpecimenBuilder();
     builder.OnCreate = (r, c) =>
     {
         Assert.NotNull(c);
         Assert.Equal(
             new SeededRequest(typeof(DateTime), default(DateTime)),
             r);
         return expected;
     };
     // Exercise system
     DateTime actual = builder.Create<DateTime>();
     // Verify outcome
     Assert.Equal(expected, actual);
     // Teardown
 }