Ejemplo n.º 1
0
        public void TestManualModifiedAndUpdate()
        {
            PrivilegeOwner obj = new PrivilegeOwner();

            obj.Name = "teddy";
            obj.ID   = 222;

            obj.Attach();

            obj.SetAllPropertiesAsModified();

            Assert.AreEqual(obj.GetModifiedProperties().Count, 1);
        }
Ejemplo n.º 2
0
        public void TestEntityBasicUsage()
        {
            PrivilegeOwner obj = new PrivilegeOwner();

            obj.Attach();
            Assert.AreEqual(obj.GetModifiedProperties(obj.GetType()).Count, 0);

            obj.Name = "teddy";
            Assert.AreEqual(new List <object>(obj.GetModifiedProperties(obj.GetType()).Values)[0], "teddy");

            obj.ResetModifiedPropertyStates();
            Assert.AreEqual(obj.GetModifiedProperties(obj.GetType()).Count, 0);

            obj.ID   = 222;
            obj.Name = "teddy2";
            obj.ID   = 222;
            obj.Name = "teddy2";
            Assert.AreEqual(obj.GetModifiedProperties(obj.GetType()).Count, 2);
        }