예제 #1
0
        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);
        }
예제 #2
0
        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);
        }