CardShopTest.ControllerTests.DiscountControllerTests.IssueDiscountBadInputsTest C# (CSharp) Метод

IssueDiscountBadInputsTest() приватный Метод

private IssueDiscountBadInputsTest ( ) : void
Результат void
        public void IssueDiscountBadInputsTest()
        {
            var mock = new Mock<IDiscountService>();
            discountTest.discountService = mock.Object;
            // sets IsValid in the controller to false
            discountTest.ModelState.AddModelError("don't work", "alrights.");
            var json = (JsonResult)discountTest.IssueDiscount(badCoupon);
               // UserDiscount returnedDiscount = (UserDiscount)json.Data;
            // verify the returned object matches object sent in
            // (if test IsValid was true, returnedDiscount would be null)
            Assert.IsInstanceOfType(json, typeof(JsonResult));
        }