public void 新增文章_Action() { ForumDB db = new ForumDB(); Action action = new Action(); db.insertArticle("teamD", "測試標題", "測試摘要22", "測試內容", "測試圖片"); Assert.That("測試標題", Is.EqualTo(db.getTitle(0))); Assert.That("測試內容", Is.EqualTo(db.getArticle(0))); Assert.That("測試內容", Is.EqualTo(action.addArticle(db, db.accounts[0], "測試標題", "測試摘要", "測試內容"))); }
public string getArticle(ForumDB db, int articleID) { return(db.getArticle(articleID));//透過資料庫動作讀取文章 }