public void WrapperHasDefaultValue() { WrapperContainer e = new WrapperContainer(); var wrappedInt = e.WrappedInt; wrappedInt.WrappedValue.Should().Be(1000); var clone = e.CloneLazinatorTyped(); clone.IsDirty.Should().BeFalse(); // even though WrapperContainer constructor executes, the FreeInMemoryObjects method will set IsDirty = false clone.WrappedInt.WrappedValue.Should().Be(1000); }
public void DirtinessWithStructChild() { WrapperContainer e = new WrapperContainer() { WrappedInt = 3 }; e.WrappedInt.IsDirty.Should().BeTrue(); e.DescendantIsDirty.Should().BeTrue(); e.SerializeLazinator(); var c = e.CloneLazinatorTyped(); // consider original, which should be clean e.IsDirty.Should().BeFalse(); e.DescendantIsDirty.Should().BeFalse(); e.WrappedInt.IsDirty.Should().BeFalse(); // now consider clone c.IsDirty.Should().BeFalse(); c.DescendantIsDirty.Should().BeFalse(); c.WrappedInt.IsDirty.Should().BeFalse(); }