예제 #1
0
        public void UsageWithInheritedProperties()
        {
            const string expectedStringValue = "expected value";
            const int    expectedIntValue    = 1;
            var          expected            = new ExtendedSampleType
            {
                IntProperty       = expectedIntValue,
                NewStringProperty = expectedStringValue
            };

            ExtendedSampleType built = A.BuilderFor <ExtendedSampleType>()
                                       .WithNewStringProperty(expectedStringValue)
                                       .WithIntProperty(expectedIntValue);

            Assert.Equal(expected, built, new ExtendedSampleTypeEqualityComparer(new SampleTypeEqualityComparer()));
        }
예제 #2
0
        public void UsageWithInheritedProperties()
        {
            const string expectedStringValue = "expected value";
            const int expectedIntValue = 1;
            var expected = new ExtendedSampleType
            {
                IntProperty = expectedIntValue,
                NewStringProperty = expectedStringValue
            };

            ExtendedSampleType built = A.BuilderFor<ExtendedSampleType>()
                                             .WithNewStringProperty(expectedStringValue)
                                             .WithIntProperty(expectedIntValue);

            Assert.Equal(expected, built, new ExtendedSampleTypeEqualityComparer(new SampleTypeEqualityComparer()));
        }