public void StartTest() { ReportLog.InitializationLogging(this.GetType().Name); ReportLog.WritingLogging(null, "Beginning of tests"); ServiceHelper.GetAllRestRequest(); GetToken(); }
/// <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); }
public void TestGetAllUser() { actualResponse = ServiceHelper.GetRequest(ServiceHelper.users, Token); ReportLog.WritingLogging(null, $"Test Get All User: result = \n {actualResponse}"); Assert.AreEqual(124, actualResponse.Length); }
public void Log(string message) { ReportLog.WritingLogging(null, message); }
public void EndTest() { ReportLog.WritingLogging(null, "Ends of tests"); ReportLog.Dispose(); }