예제 #1
0
        public async Task <ActionResult <Guid> > Create([FromBody] CreateJobOrderCommand command)
        {
            var request    = new ContextualRequest <CreateJobOrderCommand, Guid> (command, "userId");
            var JobOrderId = await Mediator.Send(request);

            return(Ok(JobOrderId));
        }
예제 #2
0
파일: Create.cs 프로젝트: habouba/JobOrder
        public async Task GivenCreateJobOrderCommand_ReturnsNewJobOrderId()
        {
            var command = new CreateJobOrderCommand
            {
                CompanyName = "Coffee",
                ContactName = "Bibo",
                Address     = "Address"
            };

            var content = Utilities.GetRequestContent(command);

            var response = await _client.PostAsync($"/api/joborders/create", content);

            response.EnsureSuccessStatusCode();

            var jobOrderId = await Utilities.GetResponseContent <int>(response);

            Assert.NotEqual(0, jobOrderId);
        }