示例#1
0
        public void ASharedArticleCreatesANewArticleReferingToTheOriginal()
        {
            Sharable sharable = new Sharable(
                // From
                "*****@*****.**",

                // To
                "*****@*****.**",

                // Article to create then share
                NullNormalized(a =>
            {
                a.Slug = "Article_Zero";
            })
                );

            // Share
            Article new_ = GetArticleLike(sharable);

            sharable.MergeWith(new_);

            // count before the operation
            int count1 = GetBlogArticlesCount(sharable.BlogDestin);

            // Operate
            Share shared = Wrapper.Share.ShareArticle(sharable, sharable.BlogDestin);

            // Count after the operation
            int count2 = GetBlogArticlesCount(sharable.BlogDestin);

            Assert.AreNotEqual(shared.BlogId, shared.SharingBlogId);
            Assert.AreNotEqual(count1, count2);
        }
示例#2
0
        public void ASharedArticleStaysUptoDate()
        {
            Sharable sharable = new Sharable(
                // From
                "*****@*****.**",

                // To
                "*****@*****.**",

                // Article to create then share
                NullNormalized(a =>
            {
                a.Title = "A Third Article, yupiie !!!";
                a.Slug  = "Third_Article";
            })
                );

            sharable.MergeWith(Wrapper.Article.CreateArticle(sharable));

            Share shared = Share(sharable, sharable.BlogDestin);

            // loop to create modifications over the third article
            LoopModify(sharable, contentUpdates[1]);

            Share resultedShare = Wrapper.Share.getShare(shared);
        }
        public void AShareGeneratesANotificationToTheAuthorOfTheArticle()
        {
            int     c1      = Wrapper.Notificaton.GetNotoficationsOf(JeanLucEmmanuel).Count;
            Blog    blog    = Wrapper.Blog.GetBlogOfAccount(JeanLucEmmanuel.Id);
            Article article =
                Wrapper.Article.CreateArticle(
                    NullNormalized <Article>(a =>
            {
                a.Content      = "Hi peeps";
                a.Title        = "Articling very spetial";
                a.Blog         = blog;
                a.VisibilityId = 1;
            })
                    );

            Sharable sharable = new Sharable(
                // From
                "*****@*****.**",

                // To
                "*****@*****.**",

                NullNormalized <Article>(a =>
            {
                a.Slug = article.Slug;
            })
                );

            // Share
            Article new_ = GetArticleLike(sharable);

            sharable.MergeWith(new_);

            // Operate
            Share shared = Wrapper.Share.ShareArticle(sharable, sharable.BlogDestin);

            int c2 = Wrapper.Notificaton.GetNotoficationsOf(JeanLucEmmanuel).Count;

            Assert.IsTrue(c1 + 1 == c2);
        }