public void TestUDCListModel() { UDCListModel udc = new UDCListModel("Data Source=isostore:/Test1.sdf", true); UserModel testUser = new UserModel("1", "foo", "bar", ""); udc.addUser(testUser); Assert.Equals(testUser, udc.UsersByFirstName[0]); Assert.IsTrue(udc.SubmitChanges()); udc.LoadListsFromDatabase(); Assert.Equals(testUser, udc.UsersByFirstName[0]); GroupModel testGroup = new GroupModel("TestGroup"); udc.addGroup(testGroup); udc.addToGroup(testUser, testGroup); Assert.IsTrue(udc.GroupList[0].Users.Contains(testUser)); CallLogEntry testEntry = new CallLogEntry(); CallLogModel testLog = new CallLogModel(1); testLog.addEntry(testEntry); testUser.CallLogs.Add(testLog); Assert.IsTrue(udc.SubmitChanges()); Assert.IsTrue(testUser.CallLogs.Any()); Assert.Equals(testUser.CallLogs.First(), testLog); udc.removeGroup("TestGroup"); Assert.IsTrue(udc.GroupList.Count == 0); }
private void detachCallLog(CallLogModel cm) { NotifyPropertyChanging("CallLogModel"); cm.User = null; NotifyOfPropertyChange("CallLogModel"); }
private void attachCallLog(CallLogModel cm) { NotifyPropertyChanging("CallLogModel"); cm.User = this; NotifyOfPropertyChange("CallLogModel"); }