public void metro7Test() { // Arrange METRO7Controller controller = new METRO7Controller(); //Act ViewResult result = controller.metro7() as ViewResult; //Assert Assert.IsNotNull(result); }
public void metro7PostTest() { //Arange //MyModel1 request = new MyModel1() { stations = new string[] { "MAKSIMIR", "DUBRAVA" } }; //MyModel2 expected = new MyModel2() { distance = 7 }; METRO7Controller controller = new METRO7Controller(); //Act //JsonResult result = controller.zagrebPost(request) as JsonResult; //string Json = new JavaScriptSerializer().Serialize(result.Data); //string expectedJson = new JavaScriptSerializer().Serialize(expected); // Assert // Assert.IsNotNull(result); // Assert.AreEqual(expectedJson, Json); }