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); }
internal static void Delete(IDataStore dataStore, ContentPlaceholderHistory contentPlaceholderHistory) { ContentPlaceholderHistoryManager manager = new ContentPlaceholderHistoryManager(dataStore); BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(contentPlaceholderHistory); Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status); Assert.IsNull(manager.GetContentPlaceholderHistory(contentPlaceholderHistory.ContentPlaceholderHistoryId)); Trace.WriteLine("Successfully deleted contentPlaceholderHistory " + contentPlaceholderHistory.ContentPlaceholderHistoryId); }
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); }
internal static ContentPlaceholderHistory Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application, ContentPlaceholder contentPlaceholder, Random random) { ContentPlaceholderHistoryManager manager = new ContentPlaceholderHistoryManager(dataStore); ContentPlaceholderHistory contentPlaceholderHistory = new ContentPlaceholderHistory( contentPlaceholder); BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(contentPlaceholderHistory); Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status); Assert.Greater(contentPlaceholderHistory.ContentPlaceholderHistoryId, 0); ContentPlaceholderHistory dsThread = manager.GetContentPlaceholderHistory(contentPlaceholderHistory.ContentPlaceholderHistoryId); Assert.IsNotNull(dsThread); return(dsThread); }
internal static ContentBlock Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application , IUserBasic author, ContentPlaceholderHistory contentPlaceholderHistory, Random random) { ContentBlockManager manager = new ContentBlockManager(dataStore); ContentBlock contentBlock = new ContentBlock( author , contentPlaceholderHistory , "ContentBlock Body" + random.Next(1000000, 10000000) , Workmate.Components.Contracts.CMS.Content.ContentBlockStatus.Active); BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(contentBlock); Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status); Assert.Greater(contentBlock.ContentBlockId, 0); ContentBlock dsContentBlock = manager.GetContentBlock(contentBlock.ContentBlockId); Assert.IsNotNull(dsContentBlock); return(dsContentBlock); }
public BusinessObjectActionReport <DataRepositoryActionStatus> Delete(ContentPlaceholderHistory contentPlaceholderHistory) { return(_CMSThreadManager.Delete(contentPlaceholderHistory.CMSThread, false)); }
internal static void PopulateWithRandomValues(ContentPlaceholderHistory record, DummyDataManager dtm, Random random) { record.IsApproved = DebugUtility.FlipCoin(random); record.IsLocked = DebugUtility.FlipCoin(random); }