public async Task WhenTheUserDeletesAnExistingItem()
 {
     await AppHooks.SendAsync(new DeleteTodoItemCommand
     {
         Id = _itemId
     });
 }
 public async Task WhenTheUserDeletesNotExistingList()
 {
     _listId             = _listCreationTask == null ? 0 : (await _listCreationTask);
     _listDeletionAction = async() => await AppHooks.SendAsync(new DeleteTodoListCommand
     {
         Id = _listId
     });
 }
 public async Task WhenTheUserDeletesAnExistingList()
 {
     _listId = await _listCreationTask;
     await AppHooks.SendAsync(new DeleteTodoListCommand
     {
         Id = _listId
     });
 }
        public void WhenTheUserCreatesANewListWithName(string listTitle)
        {
            _createTodoListCommand = new CreateTodoListCommand
            {
                Title = listTitle
            };

            _listCreationTask = AppHooks.SendAsync(_createTodoListCommand);
        }
        public async Task ThenTheSystemShouldHaveNewListCreated()
        {
            _listId = await _listCreationTask;
            var list = await AppHooks.FindAsync <TodoList>(_listId);

            list.Should().NotBeNull();
            list.Title.Should().Be(_createTodoListCommand.Title);
            list.CreatedBy.Should().Be(_userId);
            list.Created.Should().BeCloseTo(DateTime.Now, 10000);
        }
        public async Task ThenTheSystemShouldHaveItemCorrectlyUpdated()
        {
            var item = await AppHooks.FindAsync <TodoItem>(_itemId);

            item.Title.Should().Be(_updateTodoItemCommand.Title);
            item.LastModifiedBy.Should().NotBeNull();
            item.LastModifiedBy.Should().Be(_userId);
            item.LastModified.Should().NotBeNull();
            item.LastModified.Should().BeCloseTo(DateTime.Now, 1000);
        }
        public async Task WhenTheUserUpdatesAnExistingItemWithTheName(string p0)
        {
            _updateTodoItemCommand = new UpdateTodoItemCommand
            {
                Id    = _itemId,
                Title = "Updated Item Title"
            };

            await AppHooks.SendAsync(_updateTodoItemCommand);
        }
        public async Task WhenTheUserCreatesANewItemInTheList(string itemTitle)
        {
            _createTodoItemCommand = new CreateTodoItemCommand
            {
                ListId = _listId,
                Title  = itemTitle
            };

            _itemId = await AppHooks.SendAsync(_createTodoItemCommand);
        }
        public async Task ThenTheSystemShouldHaveNewItemCreatedInTheList()
        {
            var item = await AppHooks.FindAsync <TodoItem>(_itemId);

            item.Should().NotBeNull();
            item.ListId.Should().Be(_createTodoItemCommand.ListId);
            item.Title.Should().Be(_createTodoItemCommand.Title);
            item.CreatedBy.Should().Be(_userId);
            item.Created.Should().BeCloseTo(DateTime.Now, 10000);
            item.LastModifiedBy.Should().BeNull();
            item.LastModified.Should().BeNull();
        }
Esempio n. 10
0
        public async Task ThenTheDeletedListMustNotExistInTheSystem()
        {
            var list = await AppHooks.FindAsync <TodoList>(_listId);

            list.Should().BeNull();
        }
Esempio n. 11
0
 public async Task GivenTheParticularUserLoggedIn()
 {
     _userId = await AppHooks.RunAsDefaultUserAsync();
 }
Esempio n. 12
0
        public async Task ThenTheItemMustNotExistInTheSystem()
        {
            var list = await AppHooks.FindAsync <TodoItem>(_itemId);

            list.Should().BeNull();
        }
Esempio n. 13
0
 public void ThenTheSystemShouldRespondWithTheValidationExceptionForEmptyItemCreation()
 {
     FluentActions.Invoking(async() => await AppHooks.SendAsync(new CreateTodoItemCommand()))
     .Should().Throw <ValidationException>();
 }