예제 #1
0
 public void StartTest()
 {
     ReportLog.InitializationLogging(this.GetType().Name);
     ReportLog.WritingLogging(null, "Beginning of tests");
     ServiceHelper.GetAllRestRequest();
     GetToken();
 }
예제 #2
0
        /// <summary>
        /// Method for Delete request
        /// </summary>
        /// <param name="searchUrlByParameter"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static string DeleteRequest(string searchUrlByParameter, params string[] parameters)
        {
            try
            {
                string          fullUrl     = UrlBuilder(FindUrl(searchUrlByParameter, HttpMethod.DELETE), parameters);
                HttpWebResponse webResponse = GetResponse(HttpMethod.DELETE, fullUrl);
                serviceResponse = GetServiceResponse(GetBody(webResponse));
            }
            catch (JsonException jsonException)
            {
                ReportLog.WritingLogging(jsonException);
            }
            catch (Exception exception)
            {
                ReportLog.WritingLogging(exception);
            }

            return(serviceResponse.content);
        }
예제 #3
0
 public void TestGetAllUser()
 {
     actualResponse = ServiceHelper.GetRequest(ServiceHelper.users, Token);
     ReportLog.WritingLogging(null, $"Test Get All User: result = \n {actualResponse}");
     Assert.AreEqual(124, actualResponse.Length);
 }
예제 #4
0
 public void Log(string message)
 {
     ReportLog.WritingLogging(null, message);
 }
예제 #5
0
 public void EndTest()
 {
     ReportLog.WritingLogging(null, "Ends of tests");
     ReportLog.Dispose();
 }