public void entity_non_disposed_should_not_dispose_metadata() { var target = new SutEntity(); target.MyProperty = "Sample"; var metadata = target.For(() => target.MyProperty); Assert.IsFalse(metadata.IsDisposed); }
public void entity_dispose_using_metadata_should_not_fail() { TestMetadata <string> metadata; using (var target = new SutEntity()) { target.MyProperty = "Sample"; metadata = target.For(() => target.MyProperty); } Assert.IsTrue(metadata.IsDisposed); }