예제 #1
0
        public async System.Threading.Tasks.Task Should_Create_New_Task_With_Title()
        {
            // Act
            await _taskAppService.CreateAsync(new SimpleTaskApp.Tasks.Dto.CreateTaskInput
            {
                Title = "Newly created task #1"
            });

            UsingDbContext(context =>
            {
                var task1 = context.Tasks.FirstOrDefault(x => x.Title == "Newly created task #1");
                task1.ShouldNotBeNull();
            });
        }
예제 #2
0
 public async Task <IActionResult> Post([FromBody] TaskForCreationDto dto)
 {
     return(Ok(await _appService.CreateAsync(dto)));
 }