public void Create_傳入不存在的分類名稱_新增資料成功() { string categoryName = "BBB"; ICategoryDAO dao = Substitute.For <ICategoryDAO>(); dao.IsExist(Arg.Any <string>()).Returns(false); var service = new CategoryService(dao); service.Create(categoryName); dao.Received().Create(categoryName); }