public void CannotInsertANewCategoryWithoutACategoryType() { DataHelper.NewDb(); var service = new RentalsService(); var categoryToAdd = new Category() { Name = "Category Name" }; service.SaveNewCategory(categoryToAdd); Assert.Fail("Category was added without a CatgeoryType"); }
public void CannotInsertNewCategorytWithSameNameAsAnExistingCategory() { DataHelper.NewDb(); var categoryToAdd = new Category() { Name = "Rental Income", Type = CategoryType.Expense }; var service = new RentalsService(); service.SaveNewCategory(categoryToAdd); Assert.Fail("Added an category with same name as an exiting category"); }
public void CanInsertNewCategory() { DataHelper.NewDb(); var service = new RentalsService(); var categoryToAdd = new Category() { Name = "Category Name", Type = CategoryType.Expense }; service.SaveNewCategory(categoryToAdd); Assert.AreEqual(DataHelper.Categories.Count + 1, service.GetNumberOfCategories()); }