Пример #1
0
        public async Task <IActionResult> Register([FromBody] ChurchRegisteringMessageRequest view)
        {
            var command = _mapper.Map <RegisterChurchCommand>(view);
            await _bus.SendCommand(command);

            //if (!ModelState.IsValid)
            //{
            //    NotifyModelStateErrors();
            //    return Response(view);
            //}

            //_app.RegisterChurch(view);

            return(Response(view));
        }
Пример #2
0
        public async Task Register_church(string name, string email, string photo, byte prefix, byte region, string telephoneFixed, string mobileTelephone)
        {
            //Arrang's
            var requestMessage = new ChurchRegisteringMessageRequest()
            {
                Name            = name,
                Email           = email,
                Photo           = photo,
                Prefix          = prefix,
                Region          = region,
                TelephoneFixed  = telephoneFixed,
                MobileTelephone = mobileTelephone
            };

            //Act
            var response = await BaseIntegrationTest.PostAsync(requestMessage, "Church/register");

            //Assert's
            response.Should().NotBeNull();
            response.IsSuccessStatusCode.Should().BeTrue();
            response.StatusCode.Should().Be(HttpStatusCode.OK);
        }