public void TestGetThreadsByCategory_ByCategoryID() { ForumSqlDAL forumSqlDal = new ForumSqlDAL(); List <ThreadModel> threadByCategoryID = forumSqlDal.GetThreadsByCategory(categoryID); Assert.IsNotNull(threadByCategoryID); Assert.AreEqual(1, threadByCategoryID.Count); }
public void TestGetAllPostsByThreadID() { ForumSqlDAL forumSqlDal = new ForumSqlDAL(); List <PostModel> threadByThreadID = forumSqlDal.GetAllPosts(threadId); Assert.IsNotNull(threadByThreadID); Assert.AreEqual(1, threadByThreadID.Count); }
public void TestGetAllCategories() { ForumSqlDAL dal = new ForumSqlDAL(); List <CategoriesModel> model = new List <CategoriesModel>(); model = dal.GetAllCategories(); Assert.AreEqual(3, model[2].CategoryID); Assert.AreEqual("Fan Fiction", model[2].CategoryName); }
public void TestGetThreadByThreadID() { ForumSqlDAL forumSqlDal = new ForumSqlDAL(); ThreadModel thread = new ThreadModel(); thread = forumSqlDal.GetThreadByThreadID(threadId); Assert.IsNotNull(thread); Assert.AreEqual(threadId, thread.ThreadID); Assert.AreEqual(1, thread.CategoryID); Assert.AreEqual("The awesome threadName", thread.ThreadName); Assert.AreEqual("12/7/2016 12:00:00 AM", thread.ThreadDate.ToString()); }
public void TestSubmitThread() { ForumSqlDAL dal = new ForumSqlDAL(); ThreadModel model = new ThreadModel(); model.UserID = userId; model.CategoryID = 2; model.ThreadName = "The awesome threadName"; bool isSubmitted = dal.SubmitThread(model); Assert.IsTrue(isSubmitted); }
public void TestSubmitPost() { ForumSqlDAL dal = new ForumSqlDAL(); PostResultsViewModel model = new PostResultsViewModel(); PostModel newPost = new PostModel(); model.NewPost = newPost; model.NewPost.ThreadID = threadId; model.NewPost.UserID = userId; model.NewPost.ThreadName = "The awesome threadName"; model.NewPost.PostBody = "This is the postBody"; bool isSubmitted = dal.SubmitPost(model); Assert.IsTrue(isSubmitted); }