public void Test_CreateUpdateDeleteThread()
        {
            ContentPlaceholderGroup contentPlaceholderGroup = Test_ContentPlaceholderGroup.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.Random);
            ContentPlaceholder      contentPlaceholder      = Test_ContentPlaceholders.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, contentPlaceholderGroup, this.Random);

            ContentPlaceholderHistoryManager manager = new ContentPlaceholderHistoryManager(this.DataStore);
            ContentPlaceholderHistory        record  = Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, contentPlaceholder, this.Random);

            ContentPlaceholderHistory recordToCompare;

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

                manager.Update(record);
                record = manager.GetContentPlaceholderHistory(record.ContentPlaceholderHistoryId);

                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_ContentPlaceholders.Delete(this.DataStore, contentPlaceholder);
            Test_ContentPlaceholderGroup.Delete(this.DataStore, contentPlaceholderGroup);
        }
Example #2
0
        public void Test_CreateUpdateDeleteContentBlock()
        {
            IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);
            ContentPlaceholderGroup   contentPlaceholderGroup   = Test_ContentPlaceholderGroup.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.Random);
            ContentPlaceholder        contentPlaceholder        = Test_ContentPlaceholders.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, contentPlaceholderGroup, this.Random);
            ContentPlaceholderHistory contentPlaceholderHistory = Test_ContentPlaceholderHistorys.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, contentPlaceholder, this.Random);

            ContentBlockManager manager = new ContentBlockManager(this.DataStore);
            ContentBlock        record  = Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, userBasic, contentPlaceholderHistory, this.Random);

            Delete(this.DataStore, record);
            Test_ContentPlaceholders.Delete(this.DataStore, contentPlaceholder);
            Test_ContentPlaceholderGroup.Delete(this.DataStore, contentPlaceholderGroup);
        }