예제 #1
0
 public static GivenStatement UserLoginCredentials(this GivenStatement givenStatement,
                                                   TestLoginModel loginCredentials, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving user credentials {loginCredentials}",
                  givenStatement.GetType().Name);
     givenStatement.AddData(loginCredentials, testKey);
     return(givenStatement);
 }
예제 #2
0
        public static GivenStatement DefaultUserLoginCredentials(this GivenStatement givenStatement,
                                                                 string testKey = null)
        {
            var loginCredentials = new TestLoginModel
            {
                Email    = _configuration.UserName,
                Password = _configuration.Password,
            };

            return(givenStatement.UserLoginCredentials(loginCredentials, testKey));
        }
예제 #3
0
 public HttpResponseMessage PostLogin(TestLoginModel login)
 {
     using (HttpClient client = HttpClientFactory.Create())
     {
         client.DefaultRequestHeaders
         .Accept
         .Add(new MediaTypeWithQualityHeaderValue(CommonHttpConstants.ApplicationJsonMedia));
         return(client.LogAndPost($"{BaseApiRoute}/{LoginRoute}",
                                  new StringContent(login.ToString(), Encoding.UTF8, CommonHttpConstants.ApplicationJsonMedia),
                                  Logger));
     }
 }