Beispiel #1
0
        public async Task Register_new_value()
        {
            //Arranger's
            var request = new ValueMessageRequest()
            {
                Value            = 10,
                MemberId         = Guid.NewGuid(),
                Name             = "Space ghost",
                TypeContribution = 1,
                ContributionDate = DateTime.Now
            };

            //Act
            try
            {
                var response = await BaseIntegrationTest.PostAsync(request, "Input/addValue");
            }
            catch (Exception ex)
            {
                throw;
            }

            //Assent's
            //response.StatusCode.Should().Be(HttpStatusCode.OK);
        }
Beispiel #2
0
        public async Task Deleted_church()
        {
            //Arrang's
            var churchId = CreateChurch();

            //Act
            var response = await BaseIntegrationTest.DeleteAsync(churchId, $"Church/delete/{churchId}");

            var result = response.Content.ReadAsStringAsync().Result;

            //Assert's
            response.Should().NotBeNull();
            response.IsSuccessStatusCode.Should().BeTrue();
            response.StatusCode.Should().Be(HttpStatusCode.OK);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public async Task Update_church()
        {
            //Arrang's
            var churchId = CreateChurch();

            var requestMessage = new ChurchUpdatedMessageRequest
            {
                Id        = churchId,
                Name      = "Name updated",
                Photo     = "Photo updated",
                Email     = "*****@*****.**",
                CellPhone = "999999999", //Telephone must be between 8 and 9 characters.
                HomePhone = "2166666666"
            };

            //Act
            var response = await BaseIntegrationTest.PutAsync(requestMessage, "Church/update");

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

            Action assert = () =>
            {
                //var unitOfWork = Setup.Container.GetService<IUnitOfWork>();
                //var churchUpdate = unitOfWork.DbSet<Church>().FirstOrDefault(x => x.Id == churchId);

                //churchUpdate.Id.Should().Be(churchId);
                //churchUpdate.Name.Should().Be(requestMessage.Name);
                //churchUpdate.Photo.Should().Be(requestMessage.Photo);
                //churchUpdate.Email.Value.Should().Be(requestMessage.Email);
                //churchUpdate.MobileTelephone.Number.Should().Be(requestMessage.MobileTelephone);
                //churchUpdate.TelephoneFixed.Number.Should().Be(requestMessage.TelephoneFixed);
            };

            assert();
        }