示例#1
0
        public void ShouldReturnCorrectReturnTypeOnTriangleType()
        {
            var controller = new TriangleTypeController();
            var response   = controller.TriangleType(1, 2, 3);

            Assert.IsInstanceOfType(response, typeof(ObjectResult));
            var result = response as ObjectResult;

            Assert.IsNotNull(result);
        }
示例#2
0
        public void ShouldReturnStatus200OnTriangleType()
        {
            var controller = new TriangleTypeController();
            var response   = controller.TriangleType(1, 2, 3);

            Assert.IsInstanceOfType(response, typeof(ObjectResult));
            var result = response as ObjectResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(200, result.StatusCode);
        }
示例#3
0
        public void ShouldReturnErrorOnTriangleTypeIfinequality()
        {
            var controller = new TriangleTypeController();
            var response   = controller.TriangleType(100, 10, 1);

            Assert.IsInstanceOfType(response, typeof(ObjectResult));
            var result = response as ObjectResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(200, result.StatusCode);
            Assert.AreEqual("Error", result.Value);
        }