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); }
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)); }
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)); } }