Пример #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();
 }