Пример #1
0
        public void UpdateCategory_InvalidID_ReturnsFalse()
        {
            var service = new EntityMapping.DataService();
            var result  = service.UpdateCategory(-1, "UpdatedName", "UpdatedDescription");

            Assert.False(result);
        }
Пример #2
0
        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);
        }