Ejemplo n.º 1
0
        public void Test_CreateUpdateDeleteContentFile()
        {
            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);
            CMSContent content   = Test_CMSContents.Create(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, userBasic.UserId, thread, this.Random);

            CMSFileManager manager = new CMSFileManager(this.DataStore);
            CMSFile        record  = CreateContentFile(this.DataStore, this.Application.ApplicationId, userBasic, content, this.Random);

            CMSFile recordToCompare;

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

                manager.Update(record);
                record = manager.GetFile(record.CMSFileId);

                string errors = string.Empty;
                // TODO (Roman): relax datetime comparisons
                Assert.IsTrue(DebugUtility.ArePropertyValuesEqual(record, recordToCompare, out errors), errors);
                Trace.WriteLine("Update test successfull.");
            }

            Test_CMSSections.Delete(this.DataStore, section); // deleting the section should also delete the file
            Assert.IsNull(manager.GetFile(record.CMSFileId));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates the specified profile image.
 /// </summary>
 /// <param name="profileImage">The profile image.</param>
 /// <returns></returns>
 public BusinessObjectActionReport <DataRepositoryActionStatus> Update(ProfileImage profileImage)
 {
     if (profileImage.IsSystemProfileImage)
     {
         throw new ArgumentException("It is not allowed to update a  profile image via the ProfileImageManager.Update method. Use SystemProfileManager.Update instead.");
     }
     return(_CMSFileManager.Update(profileImage.CMSFile));
 }
Ejemplo n.º 3
0
 public BusinessObjectActionReport <DataRepositoryActionStatus> Update(ArticleImage articleImage)
 {
     return(_CMSFileManager.Update(articleImage.CMSFile));
 }