public void PostAsync_ShouldReturnBadRequest_IfModelStateHasIssues()
        {
            //arrange
            var controller = new CoordinateListController(_cooServiceMock.Object);

            controller.ModelState.AddModelError("id", "could not parse value");

            //act
            var result = controller.PostAsync(new CoordinateList(10, "test", null)).Result;

            //verify
            Assert.IsType <BadRequestObjectResult>(result);
        }
        public void PostAsync_ShouldReturnBadRequest_IfModelIsInvalid()
        {
            //arrange
            const int id = 10;

            _cooServiceMock.Setup(s => s.GetList(id)).ReturnsAsync(new Entities.CoordinateList(id, "test"));
            var controller = new CoordinateListController(_cooServiceMock.Object);

            //act
            var result = controller.PostAsync(
                new CoordinateList(
                    10,
                    "test",
                    new List <Coordinate>()
            {
                new Coordinate(999999999, 52)
            })
                ).Result;

            //verify
            Assert.IsType <BadRequestObjectResult>(result);
        }