Example #1
0
        public async Task GivenStartLogCommand_ReturnStartLogResult()
        {
            // Arrange
            var now     = DateTime.Now;
            var command = new StartLogCommand
            {
                Identifier = "ENG-1",
                Start      = now
            };

            //Act
            var requestContent = Utilities.GetRequestContent(command);
            var response       = await _client.PostAsync("api/issue/startlog", requestContent);

            var result = await Utilities.GetResponseContent <StartLogResult>(response);

            //Assert
            response.EnsureSuccessStatusCode();
            Assert.Equal("ENG-1", result.Identifier);
            Assert.Equal(now, result.Start);
        }
Example #2
0
        public async Task <IActionResult> StartLog(StartLogCommand command)
        {
            var result = await Mediator.Send(command);

            return(Ok(result));
        }