public async void ReturnAllTodoItem() { var expected = new List <NirvanaTask>(_testData.Where(t => t.Type == TaskType.TodoItem)); var sut = new TodoItemService(new FakeTaskService(_testData)); var actual = await sut.GetTodoItems(); actual.Should().BeEquivalentTo(expected); }
public async void AddNewTodoItemToInboxAsync() { var taskName = "Test Item"; var task = new NirvanaTask { Name = taskName, Type = TaskType.TodoItem, State = TaskState.Inbox }; var expected = new List <NirvanaTask>(_testData.Where(t => t.Type == TaskType.TodoItem)); expected.Add(task); var sut = new TodoItemService(new FakeTaskService(_testData)); var actual = await sut.AddNewTodoItemToInbox(taskName); var tasks = await sut.GetTodoItems(); actual.Should().BeTrue(); tasks.Should().BeEquivalentTo(expected); }
public IActionResult GetTodoItems() { return(_todoItemService.GetTodoItems()); }
public void TestGetTodoItemCount(string userName, int page, int pageSize, string searchString, bool?isCompleted, int expectedItemCount) { Assert.That(todoItemService.GetTodoItems(userName, page, pageSize, searchString, isCompleted).Count(), Is.EqualTo(expectedItemCount)); }
private protected async Task GetTodoItems() { _todoItems = await TodoItemService.GetTodoItems(); }