Beispiel #1
0
        public void ArticleList()
        {
            var ArticleService = DbFixture.GetRequiredService <ArticleService>();

            try
            {
                //Arrange 初始化
                Guid catId = new Guid();
                //Act 行為
                var test = ArticleService.ArticleList(catId);
                //Assert 驗證結果
                Assert.True(test.Result != null, "測試通過");
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        public void DuplicateName()
        {
            var CategoryService = DbFixture.GetRequiredService <CategoryService>();

            try
            {
                //Arrange 初始化
                string category_name = "熱血";
                //Act 行為
                var test = CategoryService.CreateCategory(category_name);
                //Assert 驗證結果
                Assert.True(test.Result == "已有相同名稱的分類", "測試通過");
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        public void NoTitle()
        {
            var ArticleService = DbFixture.GetRequiredService <ArticleService>();

            try
            {
                //Arrange 初始化
                var para = new ArticleViewModel_para()
                {
                    category_id     = "6ca72fa3-c617-4a33-9ffd-3227c970dd60",
                    article_name    = "",
                    article_content = "空白"
                };
                //Act 行為
                var test = ArticleService.CreateArticle(para);
                //Assert 驗證結果
                Assert.True(test.Result == "文章名稱沒填", "測試通過");
            }
            catch (Exception)
            {
                throw;
            }
        }