public async void Task_GetAll_Return_OkResult() { //Arrange var controller = new OrderLinkController(MatchbookDbContextWithData); //var linkId = 1; //Act var data = controller.Get(); //Assert Assert.IsType <Task <ActionResult <List <OrderLinkSummary> > > >(data); }
public async void Task_GetLinkById_Return_NotFoundResult() { //Arrange var controller = new OrderLinkController(MatchbookDbContextWithData); var linkId = 1; //Act var data = controller.Get(1); //Assert Assert.IsType <NotFoundResult>(data); }
public async void Task_GetLinkById_Return_OKResult() { //Arrange var controller = new OrderLinkController(MatchbookDbContextWithData); var linkId = 1; var linkid = new OrderLink { LinkedOrders = new List <Order> { DataGenerator.NewOrder(), DataGenerator.NewOrder() }, LinkName = "Test" }; MatchbookDbContextWithData.OrderLink.Add(linkid); MatchbookDbContextWithData.SaveChanges(); //Act var data = controller.Get(linkId); //Assert Assert.IsType <OkObjectResult>(data); }