예제 #1
0
        public async Task TaxaJurosControllerTest()
        {
            var client = await _factory.GetClient();

            var response = await client.GetAsync($"/api/calculajuros?valorinicial=100&meses=5");

            var responseMessage = response.EnsureSuccessStatusCode();

            var result = await responseMessage.Content.ReadAsStringAsync();

            result.ShouldBe("105.1");
        }
예제 #2
0
        public async Task GetAttractionCategoryDetails_ShouldReturnSuccessWithData()
        {
            var client = _factory.GetClient();

            string guid = "24a31ba7-4030-48ed-a705-c5584f7ff860";

            var response = await client.GetAsync($"/attractioncategories/{guid}");

            response.EnsureSuccessStatusCode();

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

            result.Should().BeOfType(typeof(AttractionCategoryDetailVm));
            result.Should().NotBeNull();
            result.Id.ToString().Should().Be(guid);
        }
        public async Task GetCountryDetails_ShouldReturnSuccessWithData()
        {
            var client = _factory.GetClient();

            string guid = "3ae4e108-e2df-4893-958a-2d76ab89b9dc";

            var response = await client.GetAsync($"/countries/{guid}");

            response.EnsureSuccessStatusCode();

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

            result.Should().BeOfType(typeof(CountryDetailVm));
            result.Should().NotBeNull();
            result.Id.ToString().Should().Be(guid);
        }
        public async Task GetCityDetails_ShouldReturnSuccessWithData()
        {
            var client = _factory.GetClient();

            string guid = "54210db9-2f35-482e-9254-90c38e5aa684";

            var response = await client.GetAsync($"/cities/{guid}");

            response.EnsureSuccessStatusCode();

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

            result.Should().BeOfType(typeof(CityDetailVm));
            result.Should().NotBeNull();
            result.Id.ToString().Should().Be(guid);
        }
        public async Task GetAttractionDetails_ShouldReturnSuccessWithData()
        {
            var client = _factory.GetClient();

            string guid = "80f20e38-6a81-4670-ad7a-b98ea83d2aa1";

            var response = await client.GetAsync($"/attractions/{guid}");

            response.EnsureSuccessStatusCode();

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

            result.Should().BeOfType(typeof(AttractionDetailVm));
            result.Should().NotBeNull();
            result.AttractionId.ToString().Should().Be(guid);
        }
예제 #6
0
        public async Task GivenInsertPacienteCommand_ReturnsSuccessStatusCode()
        {
            var client = _factory.GetClient();

            var command = new UpsertPacienteCommand
            {
                Id               = null
                , PrimerNombre   = "Daniel"
                , PrimerApellido = "Aguilar"
                , Cedula         = "1028999"
                , TipoCedula     = "CE"
            };

            var content = Utilities.GetRequestContent(command);

            var response = await client.PostAsync($"/api/Pacientes/Upsert", content);

            response.EnsureSuccessStatusCode();
        }
예제 #7
0
        public async Task GivenDeletePacienteCommand_ReturnsSuccessStatusCode()
        {
            var client = _factory.GetClient();

            var validId = 1;

            var response = await client.DeleteAsync($"/api/Pacientes/Delete/{validId}");

            response.EnsureSuccessStatusCode();
        }
예제 #8
0
        public async Task TaxaJurosControllerTest()
        {
            var client = await _factory.GetClient();

            var response = await client.GetAsync($"/api/taxajuros");

            var responseMessage = response.EnsureSuccessStatusCode();

            var result = await responseMessage.Content.ReadAsStringAsync();

            result.ShouldBe("0.01");
        }
예제 #9
0
파일: GetById.cs 프로젝트: spk27/oncologia
        public async Task ReturnsPacientesListViewModel()
        {
            var client = _factory.GetClient();

            var validId = 1;

            var response = await client.GetAsync($"/api/Pacientes/Get/{validId}");

            response.EnsureSuccessStatusCode();

            var vm = await Utilities.GetResponseContent <PacienteDetailVm>(response);

            Assert.IsType <PacienteDetailVm>(vm);
            Assert.NotNull(vm);
            vm.Id.ShouldBe(1);
        }
예제 #10
0
        async Task ValidatePassword(string password, bool shouldBeValid)
        {
            try
            {
                var client          = _factory.GetClient();
                var passwordEncoded = HttpUtility.UrlEncode(password);
                var response        = await client.GetAsync($"/api/auth/is-valid-password?password={passwordEncoded}");

                var responseObj = await _factory.GetResponseContent <ValidatePasswordDTO>(response);

                response.EnsureSuccessStatusCode();

                Assert.NotNull(responseObj);
                Assert.Equal(responseObj.IsValid, shouldBeValid);
            }
            catch (Exception)
            {
                throw;
            }
        }