public void IsPropertyDirtyIsnt()
        {
            var foo = new Foo(new[] { "Name" }, new Dictionary <string, object> {
                { "Name", "Mark" }
            });
            var inspector = new TrackedEntityInspector <Foo>(foo);

            Assert.False(inspector.IsPropertyDirty(f => f.Bar));
        }
        public void GetOldValueWorks()
        {
            var foo = new Foo(new[] { "Name" }, new Dictionary <string, object> {
                { "Name", "Mark" }
            });
            var inspector = new TrackedEntityInspector <Foo>(foo);

            Assert.Equal("Mark", inspector.GetOldValue(f => f.Name));
        }
Beispiel #3
0
        public void SessionExtensionWorks()
        {
            var foo = new Foo(new[] { "Name" }, new Dictionary <string, object> {
                { "Name", "Mark" }
            });
            var inspector = new TrackedEntityInspector <Foo>(foo);

            Assert.True(inspector.IsPropertyDirty(f => f.Name));
        }
Beispiel #4
0
        public void IsNotDirtyIfDoesNotHaveDirtyProps()
        {
            var foo = new Foo(new string[0], new Dictionary <string, object>())
            {
                Name = "James"
            };
            var inspector = new TrackedEntityInspector <Foo>(foo);

            Assert.False(inspector.IsDirty());
        }
Beispiel #5
0
        public void IsDirtyIfHasDirtyProps()
        {
            var foo = new Foo(new[] { "Name" }, new Dictionary <string, object> {
                { "Name", "Mark" }
            })
            {
                Name = "James"
            };
            var inspector = new TrackedEntityInspector <Foo>(foo);

            Assert.True(inspector.IsDirty());
        }
 public void GetOldValueWorks() {
     var foo = new Foo(new[] { "Name" }, new Dictionary<string, object> { { "Name", "Mark" } });
     var inspector = new TrackedEntityInspector<Foo>(foo);
     Assert.Equal("Mark", inspector.GetOldValue(f => f.Name));
 }
 public void IsPropertyDirtyIsnt() {
     var foo = new Foo(new[] { "Name" }, new Dictionary<string, object> { { "Name", "Mark" } });
     var inspector = new TrackedEntityInspector<Foo>(foo);
     Assert.False(inspector.IsPropertyDirty(f => f.Bar));
 }