コード例 #1
0
        public void ValidateCategory_ValidCategory_ReturnTrue()
        {
            var category = new Category
            {
                Name = "Test name",
                Description = "Test description",
                IconPath = "glyphicon-record",
                Type = CategoryType.Expense
            };

            var categoryService = new CategoryService(ProvidersFactory.GetNewTransactionsProviders());
            Assert.DoesNotThrow(() => categoryService.Validate(category));
        }
コード例 #2
0
        public void ValidateCategory_EmptyName_ThrowException()
        {
            var category = new Category
            {
                Name = string.Empty,
                Description = "Test description",
                IconPath = "glyphicon-record",
                Type = CategoryType.Expense
            };

            var categoryService = new CategoryService(ProvidersFactory.GetNewTransactionsProviders());
            categoryService.Validate(category);
        }
コード例 #3
0
 public void ValidateCategory_NullCategory_ThrowException()
 {
     var categoryService = new CategoryService(ProvidersFactory.GetNewTransactionsProviders());
     categoryService.Validate(null);
 }