public void Test_CreateUpdateDeletePrivateMessage() { IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager); Inbox inbox = Test_Inboxs.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.Random); Folder folder = Test_Folders.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, inbox, this.Random); PrivateMessageManager manager = new PrivateMessageManager(this.DataStore); PrivateMessage record = Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, userBasic, folder, this.Random); PrivateMessage recordToCompare; for (int i = 0; i < this.DefaultUpdateTestIterations; i++) { PopulateWithRandomValues(record, this.DummyDataManager, this.Random); recordToCompare = record; manager.Update(record); record = manager.GetPrivateMessage(record.PrivateMessageId); string errors = string.Empty; // TODO (Roman): relax datetime comparisons Assert.IsTrue(DebugUtility.ArePropertyValuesEqual(record, recordToCompare, out errors), errors); Trace.WriteLine("Update test successfull."); } Delete(this.DataStore, record); Test_Inboxs.Delete(this.DataStore, inbox); }
public void Test_Delete_Inbox() { IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager); Inbox inbox = Test_Inboxs.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.Random); Folder folder = Test_Folders.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, inbox, this.Random); PrivateMessage privateMessage = Test_PrivateMessages.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, userBasic, folder, this.Random); Test_Inboxs.Delete(this.DataStore, inbox); FolderManager folderManager = new FolderManager(this.DataStore); PrivateMessageManager privateMessageManager = new PrivateMessageManager(this.DataStore); Assert.IsNull(folderManager.GetFolder(folder.FolderId)); Assert.IsNull(privateMessageManager.GetPrivateMessage(privateMessage.PrivateMessageId)); }