public void TestJiraLogin() { JiraLogin jiraLogin = new JiraLogin() { username = "******", password = "******" }; IRestClient client = new RestClient() { BaseUrl = new Uri("http://localhost:9191") }; IRestRequest request = new RestRequest() { Resource = LoginEndpoint }; request.RequestFormat = DataFormat.Json; request.AddJsonBody(jiraLogin); request.AddHeader("Contenet-Type", "application/json"); var response = client.Post <LoginResponse>(request); Console.WriteLine(response.Data); }
public void TestJirAApi() { JiraLogin jiraLogin = new JiraLogin() { username = "******", password = "******" }; IRestClient restClient = new RestClient() { BaseUrl = new Uri("http://localhost:9191/") }; IRestRequest restRequest = new RestRequest() { Resource = LoginEndPoint }; restRequest.RequestFormat = DataFormat.Json; restRequest.AddJsonBody(jiraLogin); restRequest.AddHeader("Content-Type", "application/json"); IRestResponse <LoginResponse> restResponse = restClient.Post <LoginResponse>(restRequest); Console.WriteLine(restResponse.Data); Assert.AreEqual(200, (int)restResponse.StatusCode); }
public Pin(JiraLogin jiraLogin) { if (instance == null || instance.IsDisposed) { instance = this; } else { this.Close(); } _jiraLogin = jiraLogin; InitializeComponent(); this.TopMost = true; Setting.Value.CurrentTheme.ApplyTheme(this, new Type[] { typeof(Label), typeof(TextBox), typeof(Button) }); }
public static void Login(TestContext context) { client = new RestClient() { BaseUrl = new Uri("http://localhost:9191") }; IRestRequest request = new RestRequest() { Resource = LoginEndPoint }; JiraLogin jiraLogin = new JiraLogin() { username = "******", password = "******" }; request.RequestFormat = DataFormat.Json; request.AddJsonBody(jiraLogin); request.AddHeader("Content-Type", "application/json"); LoginResponse = client.Post <LoginResponse>(request); Assert.AreEqual(200, (int)LoginResponse.StatusCode); }