public void PreSavingModifiedDataProcessing()
        {
            _entry.CreateDate = _testDate;
            var contentCategory    = new ContentCategory();
            var subContentCategory = new ContentSubcategory();

            var existingEntry = new Entry
            {
                Title       = Resources.ModifiedEntryTitle,
                Description = Resources.ModifiedEntryDescription,
                Content     = Resources.ModifiedEntryContent,
                ImageUrl    = Resources.ModifiedEntryImgUrl
            };

            Thread.Sleep(1000);
            _entryManageService.PreSavingModifiedDataProcessing(_account, _entry, contentCategory, subContentCategory, existingEntry);

            Assert.AreEqual(_entry.LastModifiedBy, _account);
            Assert.Greater(_entry.LastModification, _testDate);
            Assert.IsNotEmpty(_entry.Paragraphs);
            StringAssert.Contains(Resources.ModificationSuffix, _entry.Title);
            StringAssert.Contains(Resources.ModificationSuffix, _entry.Description);
            StringAssert.Contains(Resources.ModificationSuffix, _entry.Content);
            StringAssert.Contains(Resources.ModificationSuffix, _entry.ImageUrl);
        }
        public void PreSavingNewDataProcessing()
        {
            var contentCategory    = new ContentCategory();
            var subContentCategory = new ContentSubcategory();

            Thread.Sleep(1000);
            _entryManageService.PreSavingNewDataProcessing(_account, _entry, contentCategory, subContentCategory);

            Assert.AreEqual(_entry.Account, _account);
            Assert.Greater(_entry.CreateDate, _testDate);
            Assert.IsNull(_entry.LastModification);
            Assert.False(_entry.IsVisible);
            Assert.IsNotEmpty(_entry.Paragraphs);
        }
Exemplo n.º 3
0
        public void PreSavingModifiedDataProcessing(Account account, Entry entry, ContentCategory contentCategory, ContentSubcategory contentSubcategory, Entry formEntry)
        {
            entry.NormalizeEntry();

            entry.ContentCategory    = contentCategory;
            entry.ContentSubcategory = contentSubcategory;
            entry.Title            = formEntry.Title;
            entry.Description      = formEntry.Description;
            entry.Content          = formEntry.Content;
            entry.ImageUrl         = formEntry.ImageUrl;
            entry.LastModifiedBy   = account;
            entry.LastModification = DateTime.Now;

            entry.GetParagraphsFromContent();
        }
Exemplo n.º 4
0
        public void PreSavingNewDataProcessing(Account account, Entry entry, ContentCategory contentCategory, ContentSubcategory contentSubcategory)
        {
            entry.NormalizeEntry();

            entry.ContentCategory    = contentCategory;
            entry.ContentSubcategory = contentSubcategory;
            entry.Account            = account;
            entry.CreateDate         = DateTime.Now;
            entry.IsVisible          = false;

            entry.GetParagraphsFromContent();
        }