Beispiel #1
0
        public void Test_CreateUpdateDeleteThread()
        {
            Inbox inbox = Test_Inboxs.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.Random);

            FolderManager manager = new FolderManager(this.DataStore);
            Folder        record  = Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, inbox, this.Random);

            Folder recordToCompare;

            for (int i = 0; i < this.DefaultUpdateTestIterations; i++)
            {
                PopulateWithRandomValues(record, this.DummyDataManager, this.Random);
                recordToCompare = record;

                manager.Update(record);
                record = manager.GetFolder(record.FolderId);

                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));
        }