public void DbRecordTest() { var target = new DbTest(); Assert.IsFalse(target.IsNew); Assert.IsFalse(target.DeleteRecord); Assert.IsFalse(target.IsModified); Assert.IsFalse(target.NeedsSave); Assert.IsFalse(target.Fields["DbTestID"].IsSet); Assert.IsFalse(target.Fields["DbTestID"].IsModified); target.BeginInit(); target.DbTestID = 0; target.EndInit(); Assert.IsNotNull(target.Fields["DbTestID"].OriginalValue); Assert.AreEqual(0, target.Fields["DbTestID"].OriginalValue); Assert.IsTrue(target.Fields["DbTestID"].IsSet); Assert.IsFalse(target.Fields["DbTestID"].IsModified); target.DbTestID = 1; Assert.IsTrue(target.Fields["DbTestID"].IsModified); }
public void NonDbPropertyTest() { var target = new DbTest(); Assert.IsFalse(target.Fields["NonDbProperty"].IsSet); target.NonDbProperty = 4; Assert.IsTrue(target.Fields["NonDbProperty"].IsSet); Assert.IsTrue(target.IsModified); Assert.IsFalse(target.NeedsSave); }
public void JoinTest() { // setup the repository for the joined object. var info = DbRecordInfo.GetRecordInfo(typeof(MyJoinedObject)); info.Repository = new MockMyJoinedObjectRepository(); var target = new DbTest(); target.JoinID = int.MinValue; Assert.IsNull(target.Join); target.JoinID = 5; Assert.IsNotNull(target.Join); Assert.AreEqual(target.JoinID, target.Join.MyID); target.JoinID = 10; Assert.IsNotNull(target.Join); Assert.AreEqual(target.JoinID, target.Join.MyID); }
public void GetNonSetValueTest() { var target = new DbTest(); var val = target.DbTestID; }
public void GetNonInitOrigValExTest() { var target = new DbTest(); Assert.IsNull(target.Fields["DbTestID"].OriginalValue); }