public void GetCategory_ValidId_ReturnsCategoryObject() { var service = new EntityMapping.DataService(); var category = service.GetCategory(1); Assert.Equal("Beverages", category.Name); }
public void DeleteCategory_ValidId_RemoveTheCategory() { var service = new EntityMapping.DataService(); var category = (EntityMapping.Category)service.CreateCategory("Test", "DeleteCategory_ValidId_RemoveTheCategory"); var result = service.DeleteCategory(category.Id); Assert.True(result); category = (EntityMapping.Category)service.GetCategory(category.Id); Assert.Null(category); }
public void UpdateCategory_NewNameAndDescription_UpdateWithNewValues() { var service = new EntityMapping.DataService(); var category = (EntityMapping.Category)service.CreateCategory("TestingUpdate", "UpdateCategory_NewNameAndDescription_UpdateWithNewValues"); var result = service.UpdateCategory(category.Id, "UpdatedName", "UpdatedDescription"); Assert.True(result); category = (EntityMapping.Category)service.GetCategory(category.Id); Assert.Equal("UpdatedName", category.Name); Assert.Equal("UpdatedDescription", category.Description); // cleanup service.DeleteCategory(category.Id); }