Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 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));
 }
Exemple #5
0
 private protected async Task GetTodoItems()
 {
     _todoItems = await TodoItemService.GetTodoItems();
 }