public async Task Get_My_Lists_Returns_Ok() { //Arrange //Act int listsCount = _listRepository.Count(); var iactionResult = await _listsController.Get(_uniqueToken); var objectResponse = iactionResult as ObjectResult; var resultObject = objectResponse.Value as List <Backend.Models.Database.TodoList>; //Assert Assert.Equal(resultObject.Count, listsCount); Assert.IsType <OkObjectResult>(iactionResult); Assert.Equal(200, objectResponse.StatusCode); }
public void Test_Get() { //Arrange var controller = new ListsController(listService); //Act var result = controller.Get(); //Assert Assert.IsInstanceOfType(result.Value, typeof(List <ToDoList>)); Assert.AreEqual(result.Value.Count, 2); }
public void Test_Get_WithId() { //Arrange var controller = new ListsController(listService); //Act var result = controller.Get("1"); //Assert Assert.IsInstanceOfType(result.Value, typeof(ToDoList)); Assert.AreEqual(result.Value.Id, data[0].Id); Assert.AreEqual(result.Value.Name, data[0].Name); Assert.AreEqual(result.Value.Items.Count, data[0].Items.Count); }