Пример #1
0
        public ActionResult Create( TransactionType transactionType)
        {
            if (ModelState.IsValid)
            {
                _service.Create(transactionType);
                return RedirectToAction("Index");
            }

            return View(transactionType);
        }
        public async Task Create_ThrowsException()
        {
            var sampleTransactionType = new TransactionType
            {
                Name    = "Debt",
                IconUrl = "/static/icons/transactiontypes/debt.png"
            };

            await Assert.ThrowsAsync <CashSchedulerException>(() => TransactionTypeService.Create(sampleTransactionType));
        }