Exemple #1
0
        public void ShouldRequireMinimumFields()
        {
            var command = new CreateTodoBasicRequest();

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <ValidationException>();
        }
Exemple #2
0
        public async Task ShouldCreateTodoItem()
        {
            var userId = await RunAsDefaultUserAsync();


            var command = new CreateTodoBasicRequest
            {
                Title = "Tasks"
            };

            var itemId = await SendAsync(command);

            var item2 = itemId.Data.FirstOrDefault();
            var item  = await FindAsync <TodoBasic>(item2.Id);

            item.Should().NotBeNull();
            item.Title.Should().Be(command.Title);
            item.CreatedBy.Should().Be(userId);
            item.Created.Should().BeCloseTo(DateTime.Now, 10000);
            item.LastModifiedBy.Should().BeNull();
            item.LastModified.Should().BeNull();
        }