コード例 #1
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);
        }
コード例 #2
0
        public void Test_CreateUpdateDeleteContentUser()
        {
            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);

            CMSContentUserManager manager = new CMSContentUserManager(this.DataStore);

            CMSContentUser record = new CMSContentUser(userBasic, content);

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

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

            Delete(this.DataStore, content, userBasic);
            Test_CMSSections.Delete(this.DataStore, section); // deleting the section should also delete the file
        }