예제 #1
0
        public void Assert_Multiply()
        {
            var example  = new ExampleController(CalculatorMock.GetMock());
            var response = example.Multiply("3", "3");

            Assert.IsNotNull(response);
            Assert.AreEqual("9", ((Response)((OkObjectResult)response).Value).ResponseData);

            response = example.Multiply("3", "a");
            Assert.IsNotNull(response);
            Assert.IsInstanceOf <BadRequestObjectResult>(response);
        }