Beispiel #1
0
        public void Category_Post_Should_Have_Have_Category_Assigned()
        {
            var category = new Category();

            var post = new Post();

            category.AddPost(post);

            Assert.AreEqual(1, category.Posts.Count());

            Assert.AreEqual(1, post.Categories.Count());
        }
Beispiel #2
0
        public void Category_Post_Can_Be_Removed()
        {
            var category = new Category();

            var post = new Post();

            category.AddPost(post);

            Assert.AreEqual(1, category.Posts.Count());

            Assert.AreEqual(1, post.Categories.Count());

            category.RemovePost(post);

            Assert.AreEqual(0, category.Posts.Count());

            Assert.AreEqual(0, post.Categories.Count());
        }