Ejemplo n.º 1
0
        public BusinessObjectActionReport <DataRepositoryActionStatus> Delete(IApplication application)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(application);
            if (businessObjectActionReport.ValidationResult.IsValid)
            {
                int num = 0;
                try
                {
                    using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                        num = dataStoreContext.wm_Applications_Delete(application.ApplicationId);
                }
                catch (Exception ex)
                {
                    _Log.Error("Error at wm_Applications_Delete", ex);
                    throw new DataStoreException(ex, true);
                }
                if (num == 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.WarnFormat("Application {0} was not deleted from the database (ErrorCode: {1})."
                                    , DebugUtility.GetObjectString(application)
                                    , num);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed;
                _Log.WarnFormat("Application {0} was not deleted from the database because the validation failed.\nReport: {1}"
                                , DebugUtility.GetObjectString(application)
                                , businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII));
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 2
0
        internal IEmail Create(IDataStore dataStore, Random random, IApplication application, IUserBasic user
                               , EmailPriority emailPriority, EmailStatus emailStatus)
        {
            EmailManager manager = new EmailManager(dataStore);

            Email email = new Email(application.ApplicationId
                                    , "Subject " + random.Next(1000000, 10000000)
                                    , "Body " + +random.Next(1000000, 10000000)
                                    , "*****@*****.**"
                                    , "*****@*****.**"
                                    , user.UserId
                                    , emailStatus
                                    , emailPriority
                                    , EmailType.UserCreated);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(email);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);

            IEmail dsEmail = manager.GetEmail(email.EmailId);

            Assert.IsNotNull(dsEmail);

            return(dsEmail);
        }
Ejemplo n.º 3
0
        public void Test_ThreadRatingCaluclations()
        {
            IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);
            CMSSection section   = Test_CMSSections.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, null, this.Random);
            CMSThread  thread    = Test_CMSThreads.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, section, this.Random);

            CMSThreadRatingManager manager = new CMSThreadRatingManager(this.DataStore);

            for (int i = 0; i < 10; i++)
            {
                userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);

                CMSThreadRating record = new CMSThreadRating(userBasic, thread, (short)i);

                BusinessObjectActionReport <RatingDataRepositoryActionStatus> report = manager.Create(record);
                Assert.AreEqual(RatingDataRepositoryActionStatus.Success, report.Status);
            }

            CMSThreadManager threadManager = new CMSThreadManager(this.DataStore);

            thread = threadManager.GetThread(section.CMSSectionType, thread.CMSThreadId);
            Assert.AreEqual(10, thread.CMSTotalRatings);
            Assert.AreEqual(45, thread.CMSRatingSum);

            Test_CMSSections.Delete(this.DataStore, section); // deleting the section should also delete the file
        }
Ejemplo n.º 4
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> DeleteTemporaryFile(int fileId, int userId)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);
            int num = 0;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_FilesTemp_Delete(fileId, userId);
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_FilesTemp_Delete", ex);
                throw new DataStoreException(ex, true);
            }
            if (num != -1002)
            {
                if (num != 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.ErrorFormat("Temporary CMSFile with id {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected;
                _Log.InfoFormat("Temporary CMSFile with id {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 5
0
        internal static CMSFile CreateContentFile(IDataStore dataStore, int applicationId, IUserBasic fileOwner, CMSContent content, Random random)
        {
            CMSFileManager manager = new CMSFileManager(dataStore);

            CMSFile file = new CMSFile(applicationId, fileOwner, FileType.PostAttachment);

            file.ContentId = content.CMSContentId;

            ASCIIEncoding encoding      = new ASCIIEncoding();
            string        contentString = "Some String " + random.Next(1000000, 10000000);

            file.CMSHeight = random.Next(10, 1000);
            file.CMSWidth  = random.Next(10, 1000);

            file.Content          = encoding.GetBytes(contentString);
            file.ContentSize      = file.Content.Length;
            file.ContentType      = "TEXT " + random.Next(1000, 10000);
            file.FileName         = "Some Name " + random.Next(1000000, 10000000);
            file.FriendlyFileName = "Some Name " + random.Next(1000000, 10000000);
            file.IsTemporary      = false;

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(file);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);

            CMSFile dsFile = manager.GetFile(file.CMSFileId);

            Assert.IsNotNull(dsFile);
            Assert.AreEqual(contentString, encoding.GetString(dsFile.Content));
            Assert.AreEqual(file.ContentId, content.CMSContentId);

            return(dsFile);
        }
Ejemplo n.º 6
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> Delete(int fileId)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            int num = 0;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_Files_Delete(fileId);
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_Files_Delete", ex);
                throw new DataStoreException(ex, true);
            }

            if (num == 0)
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                _Log.ErrorFormat("CMSFile {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
            }

            return(businessObjectActionReport);
        }
Ejemplo n.º 7
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> DeleteTemporaryFiles(IUserBasic userBasic, FileType fileType)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);
            int num = 0;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_FilesTemp_DeleteByUserId(userBasic.UserId, fileType);
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_FilesTemp_DeleteByUserId", ex);
                throw new DataStoreException(ex, true);
            }
            if (num != -1002)
            {
                if (num != 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.ErrorFormat("Temporary profile images of user with id {0} were not deleted from the database (ErrorCode: {1}).", userBasic.UserId
                                     , num);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected;
                _Log.ErrorFormat("Temporary profile images of user with id {0} were not deleted from the database (ErrorCode: {1}).", userBasic.UserId
                                 , num);
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 8
0
        internal static CMSContent Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application
                                          , int authorUserId, CMSThread thread, Random random)
        {
            CMSContentManager manager = new CMSContentManager(dataStore);

            CMSContent content = new CMSContent(
                authorUserId
                , thread
                , 0
                , 0
                , "Content Status" + random.Next(1000000, 10000000)
                , "Content Body" + random.Next(1000000, 10000000)
                , true);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(content, null, null, false, false, null, null, null);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.Greater(content.CMSContentId, 0);

            CMSContent dsContent = manager.GetContent(content.CMSContentId);

            Assert.IsNotNull(dsContent);

            return(dsContent);
        }
Ejemplo n.º 9
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> Delete(CMSThreadRating cmsThreadRating)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(cmsThreadRating);
            if (businessObjectActionReport.ValidationResult.IsValid)
            {
                int num = 0;
                try
                {
                    using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                    {
                        num = dataStoreContext.cms_ThreadRatings_Delete(cmsThreadRating.CMSUserId, cmsThreadRating.CMSThreadId);
                    }
                }
                catch (Exception ex)
                {
                    _Log.Error("Error at cms_ThreadRatings_Delete", ex);
                    throw new DataStoreException(ex, true);
                }
                if (num != 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.WarnFormat("CMSThreadRating {0} was not deleted from the database (ErrorCode: {1})."
                                    , DebugUtility.GetObjectString(cmsThreadRating), num);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed;
                _Log.WarnFormat("CMSThreadRating {0} was not deleted from the database because the validation failed.\nReport: {1}", DebugUtility.GetObjectString(cmsThreadRating), businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII));
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 10
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> Delete(CMSContent cmsContent, bool deleteLinkedThreads)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(cmsContent);
            if (businessObjectActionReport.ValidationResult.IsValid)
            {
                int num = this.Delete(cmsContent.CMSContentId, deleteLinkedThreads);
                if (num == 0 || num == -1003)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected;
                }
                else if (num < 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.WarnFormat("CMSContent {0} was not deleted from the database (ErrorCode: {1})."
                                    , DebugUtility.GetObjectString(cmsContent)
                                    , num);
                }
                else
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.Success;
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed;
                _Log.WarnFormat("CMSContent {0} was not deleted from the database because the validation failed.\nReport: {1}"
                                , DebugUtility.GetObjectString(cmsContent)
                                , businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII));
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 11
0
        public BusinessObjectActionReport <DataRepositoryActionStatus> Update(IDepartmentModel department)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(department);
            if (businessObjectActionReport.ValidationResult.IsValid)
            {
                int num;
                try
                {
                    using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                        num = dataStoreContext.wm_Departments_Update(department.DepartmentId, department.ParentDepartmentId, department.Name, department.OfficeId);
                }
                catch (Exception ex)
                {
                    _Log.Error("Error at wm_Departments_Update", ex);
                    throw new DataStoreException(ex, true);
                }
                if (num == 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected;
                    _Log.ErrorFormat("Department {0} was not updated at the database, NoRecordRowAffected"
                                     , DebugUtility.GetObjectString(department));
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed;
                _Log.WarnFormat("Department {0} was not updated at the database because the validation failed.\nReport: {1}"
                                , DebugUtility.GetObjectString(department)
                                , businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII));
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 12
0
        internal static SystemProfileImage CreateSystemProfileImage(IDataStore dataStore, int applicationId, Random random)
        {
            SystemProfileImageManager manager = new SystemProfileImageManager(dataStore);

            SystemProfileImage file = new SystemProfileImage(applicationId);

            ASCIIEncoding encoding      = new ASCIIEncoding();
            string        contentString = "Some String " + random.Next(1000000, 10000000);

            file.Height = random.Next(10, 1000);
            file.Width  = random.Next(10, 1000);

            file.Content          = encoding.GetBytes(contentString);
            file.ContentSize      = file.Content.Length;
            file.ContentType      = "TEXT " + random.Next(1000, 10000);
            file.FriendlyFileName = "Some Name " + random.Next(1000000, 10000000);
            file.IsTemporary      = false;

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(file);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);

            SystemProfileImage dsFile = manager.GetSystemProfileImage(file.ImageId);

            Assert.IsNotNull(dsFile);
            Assert.AreEqual(contentString, encoding.GetString(dsFile.Content));

            return(dsFile);
        }
Ejemplo n.º 13
0
        internal static CMSSection Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application, CMSGroup group, Random random)
        {
            CMSSectionManager manager = new CMSSectionManager(dataStore);

            CMSSectionType sectionType = DebugUtility.GetRandomEnum <CMSSectionType>(random);

            CMSSection section = new CMSSection(
                application.ApplicationId
                , "TestSection " + random.Next(1000000, 10000000)
                , true
                , false
                , sectionType);

            if (group != null)
            {
                section.CMSGroupId = group.CMSGroupId;
            }

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(section);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.Greater(section.CMSSectionId, 0);

            CMSSection dsSection = manager.GetSection(sectionType, section.CMSSectionId);

            Assert.IsNotNull(dsSection);
            if (group != null)
            {
                Assert.AreEqual(section.CMSGroupId, group.CMSGroupId);
            }

            return(dsSection);
        }
Ejemplo n.º 14
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> Update(CMSGroup cmsGroup)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(cmsGroup);
            if (businessObjectActionReport.ValidationResult.IsValid)
            {
                try
                {
                    using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                        businessObjectActionReport.Status = (DataRepositoryActionStatus)dataStoreContext.cms_Groups_InsertOrUpdate(cmsGroup.CMSGroupId, cmsGroup.Name, cmsGroup.Description, cmsGroup.CMSGroupType);

                    return(businessObjectActionReport);
                }
                catch (Exception ex)
                {
                    _Log.Error("Error at cms_Groups_InsertOrUpdate", ex);
                    throw new DataStoreException(ex, true);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed;
                _Log.WarnFormat("CMSGroup {0} was not updated at the database because the validation failed.\nReport: {1}"
                                , DebugUtility.GetObjectString(cmsGroup)
                                , businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII));
            }
            return(businessObjectActionReport);
        }
Ejemplo n.º 15
0
        public void Test_CreateUpdateDeleteThreadRating()
        {
            IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);
            CMSSection section   = Test_CMSSections.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, null, this.Random);
            CMSThread  thread    = Test_CMSThreads.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, section, this.Random);

            CMSThreadRatingManager manager = new CMSThreadRatingManager(this.DataStore);

            CMSThreadRating record = new CMSThreadRating(userBasic, thread, 1);

            BusinessObjectActionReport <RatingDataRepositoryActionStatus> report = manager.Create(record);

            Assert.AreEqual(RatingDataRepositoryActionStatus.Success, report.Status);

            CMSThreadRating recordToCompare;

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

                manager.Update(record);
                record = manager.GetThreadRating(thread, userBasic);

                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, thread, userBasic);
            Test_CMSSections.Delete(this.DataStore, section); // deleting the section should also delete the file
        }
Ejemplo n.º 16
0
        internal static Message Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application
                                       , IUserBasic author, MessageBoardThread messageBoardThread, Random random)
        {
            MessageManager manager = new MessageManager(dataStore);

            Message message = new Message(
                author
                , messageBoardThread
                , "Message Subject" + random.Next(1000000, 10000000)
                , "Message Body" + random.Next(1000000, 10000000));

            message.MessageStatus = DebugUtility.GetRandomEnum <MessageStatus>(random);


            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(message);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.Greater(message.MessageId, 0);

            Message dsMessage = manager.GetMessage(message.MessageId);

            Assert.IsNotNull(dsMessage);

            return(dsMessage);
        }
Ejemplo n.º 17
0
        internal static void Delete(IDataStore dataStore, CMSContent content, IUserBasic userBasic)
        {
            CMSContentUserManager manager = new CMSContentUserManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(new CMSContentUser(userBasic, content));

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Trace.WriteLine("Successfully deleted contentUser " + content.CMSContentId + " -> " + userBasic.UserId);
        }
Ejemplo n.º 18
0
        public void InitializeTestSuite()
        {
            if (_IsInstanciated)
            {
                return;
            }

            Trace.WriteLine("////////////////////////////////////////////////////////////////////");
            Trace.WriteLine("       INIT table mappings START");
            Trace.WriteLine("////////////////////////////////////////////////////////////////////\n");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            UniqueUserManager.GetUser(Guid.NewGuid());
            stopwatch.Stop();
            Trace.WriteLine("Tablemappings initialization time: " + stopwatch.Elapsed.ToString());

            stopwatch.Reset();
            stopwatch.Start();
            UniqueUserManager.GetUserPage(0, 10);
            stopwatch.Stop();
            Trace.WriteLine("Stored Procedure initialization time: " + stopwatch.Elapsed.ToString());


            DummyDataManager dtm    = new DummyDataManager(System.Configuration.ConfigurationSettings.AppSettings["XmlDummyDataPath"]);
            Random           random = new Random();

            DummyUser  dummy = dtm.GetDummy();
            UniqueUser user  = new UniqueUser()
            {
                AccountStatus         = 0,
                City                  = dummy.City,
                DateOfBirth           = dummy.DateOfBirth,
                Firstname             = dummy.Firstname,
                IsNewletterSubscriber = (random.Next(0, 2) == 1),
                Lastname              = dummy.Surname,
                Timezone              = random.NextDouble() * 10
            };

            stopwatch.Reset();
            stopwatch.Start();
            BusinessObjectActionReport <UniqueUserActionStatus> report = UniqueUserManager.Create(user);

            report = UniqueUserManager.Delete(user);
            stopwatch.Stop();
            Trace.WriteLine("Stored Procedure initialization time: " + stopwatch.Elapsed.ToString());
            Trace.WriteLine("\n////////////////////////////////////////////////////////////////////");
            Trace.WriteLine("       INIT table mappings END ");
            Trace.WriteLine("////////////////////////////////////////////////////////////////////\n\n\n");
            Trace.WriteLine("       START TESTS ");
            Trace.WriteLine("////////////////////////////////////////////////////////////////////\n");

            _IsInstanciated = true;
        }
        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);
        }
Ejemplo n.º 20
0
        internal static void Delete(IDataStore dataStore, CMSGroup group)
        {
            CMSGroupManager manager = new CMSGroupManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(group);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetGroup(group.CMSGroupId));

            Trace.WriteLine("Successfully deleted group " + group.Name);
        }
Ejemplo n.º 21
0
        internal static void Delete(IDataStore dataStore, CMSContent content)
        {
            CMSContentManager manager = new CMSContentManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(content, true);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetContent(content.CMSContentId));

            Trace.WriteLine("Successfully deleted content " + content.Subject);
        }
Ejemplo n.º 22
0
        internal static void Delete(IDataStore dataStore, Folder folder)
        {
            FolderManager manager = new FolderManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(folder);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetFolder(folder.FolderId));

            Trace.WriteLine("Successfully deleted folder " + folder.FolderName);
        }
Ejemplo n.º 23
0
        internal static void Delete(IDataStore dataStore, ArticleGroupThread articleGroupThread)
        {
            ArticleGroupThreadManager manager = new ArticleGroupThreadManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(articleGroupThread);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetArticleGroupThread(articleGroupThread.ArticleGroupThreadId));

            Trace.WriteLine("Successfully deleted articleGroupThread " + articleGroupThread.Name);
        }
Ejemplo n.º 24
0
        internal static void Delete(IDataStore dataStore, CMSFile file)
        {
            CMSFileManager manager = new CMSFileManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(file);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetFile(file.CMSFileId));

            Trace.WriteLine("Successfully deleted file " + file.FileName);
        }
Ejemplo n.º 25
0
        internal static void Delete(IDataStore dataStore, Inbox inbox)
        {
            InboxManager manager = new InboxManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(inbox);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetInbox(inbox.InboxId));

            Trace.WriteLine("Successfully deleted inbox " + inbox.Name);
        }
Ejemplo n.º 26
0
        internal static void Delete(IDataStore dataStore, IApplication application)
        {
            ApplicationManager manager = new ApplicationManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(application);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetApplication(application.ApplicationName));

            Trace.WriteLine("Successfully deleted application " + application.ApplicationName);
        }
Ejemplo n.º 27
0
        internal static void Delete(IDataStore dataStore, MessageBoardThread messageBoardThread)
        {
            MessageBoardThreadManager manager = new MessageBoardThreadManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(messageBoardThread);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetMessageBoardThread(messageBoardThread.MessageBoardThreadId));

            Trace.WriteLine("Successfully deleted messageBoardThread " + messageBoardThread.MessageBoardId);
        }
Ejemplo n.º 28
0
        internal static void Delete(IDataStore dataStore, ProfileImage file)
        {
            ProfileImageManager manager = new ProfileImageManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(file);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetProfileImage(file.ImageId));

            Trace.WriteLine("Successfully deleted file " + file.FriendlyFileName ?? string.Empty);
        }
Ejemplo n.º 29
0
        internal static void Delete(IDataStore dataStore, ContentBlock contentBlock)
        {
            ContentBlockManager manager = new ContentBlockManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(contentBlock);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetContentBlock(contentBlock.ContentBlockId));

            Trace.WriteLine("Successfully deleted contentBlock " + contentBlock.Subject);
        }
Ejemplo n.º 30
0
        internal static void Delete(IDataStore dataStore, CMSThread thread, CMSSectionType sectionType)
        {
            CMSThreadManager manager = new CMSThreadManager(dataStore);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Delete(thread, true);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);
            Assert.IsNull(manager.GetThread(sectionType, thread.CMSThreadId));

            Trace.WriteLine("Successfully deleted thread " + thread.CMSName);
        }