public void With_Should_GenerateCopyOfStub() { var original = StubFactory.GetWithStub(); var with = original.With(); Assert.IsType <WithStub>(original); Assert.IsType <WithStub>(with); Assert.Equal(original.IntProperty, with.IntProperty); Assert.Equal(original.DoubleProperty, with.DoubleProperty); Assert.Equal(original.StringProperty, with.StringProperty); Assert.Equal(original.GuidProperty, with.GuidProperty); Assert.Equal(original.DateTimeOffsetProperty, with.DateTimeOffsetProperty); with.IntProperty++; with.DoubleProperty++; with.StringProperty = with.StringProperty.ToUpper(); original.GuidProperty = Guid.NewGuid(); original.DateTimeOffsetProperty = original.DateTimeOffsetProperty.AddSeconds(1); Assert.NotEqual(original.IntProperty, with.IntProperty); Assert.NotEqual(original.DoubleProperty, with.DoubleProperty); Assert.NotEqual(original.StringProperty, with.StringProperty); Assert.NotEqual(original.GuidProperty, with.GuidProperty); Assert.NotEqual(original.DateTimeOffsetProperty, with.DateTimeOffsetProperty); }