Beispiel #1
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;
            }
        }