Exemplo n.º 1
0
        public void UpdateCategory_CannotUpdateIfItDoesntExist_ReturnObjectNotFoundException()
        {
            // Arrange
            var category = new TaskCategoryEntity()
            {
                Id       = "Guid 1",
                DateTime = DateTime.Now,
                Title    = "Daily",
            };

            ITaskCategoryRepository repository = new TaskCategoryRepository();

            // Act
            repository.UpdateCategory(category);
        }
Exemplo n.º 2
0
        public void UpdateCategory_CanUpdateValidCategory_ReturnCategory()
        {
            // Arrange
            var category = new TaskCategoryEntity()
            {
                Id       = "Guid 1",
                DateTime = DateTime.Now,
                Title    = "Daily",
            };

            ITaskCategoryRepository repository = new TaskCategoryRepository();

            repository.AddCategory(category);

            // Act
            var result = repository.UpdateCategory(category);

            repository.DeleteCategoryById(category.Id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(category, result);
        }