public void TestGetOne() { //Arrange TestsController controller = new TestsController(); //Act IActionResult p = controller.Get(3); OkObjectResult result = p as OkObjectResult; //Assert Assert.IsNotNull(result); Assert.AreEqual(result.StatusCode, 200); }
public void TestGetOneIDNotFound() { //Arrange TestsController controller = new TestsController(); //Act IActionResult p = controller.Get(50); StatusCodeResult result = p as StatusCodeResult; //Assert Assert.IsNotNull(result); Assert.AreEqual(result.StatusCode, 404); }
public void TestGetAll() { //Arrange List <Test> tests = new List <Test>(); TestsController controller = new TestsController(); bool check; //Act tests = controller.Get(); check = tests.Count > 0; //Assert Assert.AreEqual(check, true); }