public void GetPortGroups_NullConnectionServer_Failure() { List <PortGroup> oPortGroups; WebCallResult res = PortGroup.GetPortGroups(null, out oPortGroups); Assert.IsFalse(res.Success, "Fetching port groups with null Connection server should fail."); }
public void GetCallHandlerTemplates_Success() { List <CallHandlerTemplate> oHandlerTemplates; WebCallResult res = _tempTenant.GetCallHandlerTemplates(out oHandlerTemplates, 1, 1); Assert.IsTrue(res.Success, "Failed to fetch call handler templates:" + res); Assert.IsTrue(oHandlerTemplates.Count == 1, "One call handler template not returned"); }
public static void MyClassCleanup() { if (_tempHandler != null) { WebCallResult res = _tempHandler.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary interview handler on cleanup."); } }
public void GetPolicies_BlankClauses_Success() { List <Policy> oPolicies; WebCallResult res = Policy.GetPolicies(_connectionServer, out oPolicies, 1, 10, ""); Assert.IsTrue(res.Success, "Failed to fetch list of policies from server"); Assert.IsTrue(oPolicies.Count > 0, "No policies returned from fetch"); }
public void GetUser_NullConnectionServer_Failure() { UserBase oUserBase; WebCallResult res = UserBase.GetUser(out oUserBase, null, "alias"); Assert.IsFalse(res.Success, "Null Connection server object should fail"); }
public static void MyClassCleanup() { if (_userTemplate != null) { WebCallResult res = _userTemplate.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary user template on cleanup."); } }
public static void MyClassCleanup() { if (_tempScheduleSet != null) { WebCallResult res = _tempScheduleSet.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary schedule set on cleanup."); } }
public void GetDirectoryHandlers_NullConnectionServer_Failure() { List <DirectoryHandler> oHandlerList; WebCallResult res = DirectoryHandler.GetDirectoryHandlers(null, out oHandlerList, 1, 10, null); Assert.IsFalse(res.Success, "GetDirectoryHandler should fail with null ConnectionServerRest passed to it"); }
public void GetDirectoryHandler_NullConnectionServer_Failure() { DirectoryHandler oHandler; WebCallResult res = DirectoryHandler.GetDirectoryHandler(out oHandler, null); Assert.IsFalse(res.Success, "GetDirectoryHandler should fail if the ConnectionServerRest is null"); }
public static void MyClassCleanup() { if (_tempCos != null) { WebCallResult res = _tempCos.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary COS on cleanup."); } }
public static void MyClassCleanup() { if (_tempGreeting != null) { WebCallResult res = _tempGreeting.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary post greeting recording on cleanup."); } }
public void GetPostGreetingRecordings_Success() { List <PostGreetingRecording> oGreetings; WebCallResult res = PostGreetingRecording.GetPostGreetingRecordings(_connectionServer, out oGreetings, 1, 2); Assert.IsTrue(res.Success, "Failed to fetch post greeting recordings:" + res); Assert.IsTrue(oGreetings.Count > 0, "No post greeting recordings returned on fetch"); }
public void AddInterviewHandler_Failure() { InterviewHandler oHandler; WebCallResult res = InterviewHandler.AddInterviewHandler(_connectionServer, "test" + Guid.NewGuid(), "", "bogus", null, out oHandler); Assert.IsFalse(res.Success, "Passing invalid recipient objectId did not result in failure on create"); }
public void UpdateCallHandler_NullConnectionServer_Failure() { ConnectionPropertyList oPropList = new ConnectionPropertyList(); WebCallResult res = CallHandler.UpdateCallHandler(null, "", oPropList); Assert.IsFalse(res.Success, "UpdateCallHandler should fail if the ConnectionServerRest parameter is null"); }
public void GetTransferOptions_NullConnectionServer_Failure() { List <TransferOption> oTransferOptions; WebCallResult res = TransferOption.GetTransferOptions(null, "objectid", out oTransferOptions); Assert.IsFalse(res.Success, "Null Connection server parameter should fail"); }
public void GetPolicies_NullConnectionServer_Failure() { List <Policy> oNewPolicies; WebCallResult res = Policy.GetPolicies(null, out oNewPolicies); Assert.IsFalse(res.Success, "Fetching policies with null connection server did not fail"); }
public void GetInterviewHandlers_NullConnectionServer_Failure() { List <InterviewHandler> oHandlers; WebCallResult res = InterviewHandler.GetInterviewHandlers(null, out oHandlers); Assert.IsFalse(res.Success, "Calling static method GetInterviewHandlers did not fail with: null ConnectionServer"); }
public void ScheduleDetailTests() { //cover all lists on the server - there must be at least one List <Schedule> oSchedules; WebCallResult res = Schedule.GetSchedules(_connectionServer, out oSchedules); Assert.IsTrue(res.Success, "Failed to fetch schedule list:" + res.ToString()); string strScheduleObjectId = ""; foreach (var oSchedule in oSchedules) { if (oSchedule.ScheduleDetails().Count > 0) { strScheduleObjectId = oSchedule.ObjectId; break; } } Assert.IsFalse(string.IsNullOrEmpty(strScheduleObjectId), "Failed to find a schedule with at least one detail element"); List <ScheduleDetail> oScheduleDetails; string strScheduleDetailObjectId = ""; res = ScheduleDetail.GetScheduleDetails(_connectionServer, strScheduleObjectId, out oScheduleDetails); Assert.IsTrue(res.Success, "Failed to fetch schedule details from schedule:" + res); foreach (var oDetail in oScheduleDetails) { Console.WriteLine(oDetail.ToString()); Console.WriteLine(oDetail.DumpAllProps()); oDetail.IsScheduleDetailActive(DateTime.Now, true); oDetail.IsScheduleDetailActive(DateTime.Now, false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(1), false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(2), false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(3), false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(4), false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(5), false); oDetail.IsScheduleDetailActive(DateTime.Now + TimeSpan.FromDays(6), false); strScheduleDetailObjectId = oDetail.ObjectId; } res = ScheduleDetail.GetScheduleDetails(null, strScheduleObjectId, out oScheduleDetails); Assert.IsFalse(res.Success, "Schedule detail fetch with null Connection server should fail"); try { ScheduleDetail oScheduleDetail = new ScheduleDetail(_connectionServer, strScheduleObjectId, strScheduleDetailObjectId); Console.WriteLine(oScheduleDetail); } catch (Exception ex) { Assert.IsTrue(false, "Failed to create a ScheduleDetial instance with valid objectIds:" + ex); } }
public void GetGreetings_NullConnectionServer_Failure() { List <Greeting> oGreetings; //Static calls for GetGreetings WebCallResult res = Greeting.GetGreetings(null, "objectid", out oGreetings); Assert.IsFalse(res.Success, "Null ConnecitonObject param should fail"); }
private PortGroupTemplate HelperGetPortGroupTemplate() { List <PortGroupTemplate> oList; WebCallResult res = PortGroupTemplate.GetPortGroupTemplates(_connectionServer, out oList); Assert.IsTrue(res.Success, "Static call to GetPortGroupTemplates failed:" + res); Assert.IsTrue(oList.Count > 0, "No port group templates found"); return(oList[0]); }
public void GetSchedulesSets_NullConnectionServer_Failure() { //get schedule sets List <ScheduleSet> oSets; WebCallResult res = ScheduleSet.GetSchedulesSets(null, out oSets); Assert.IsFalse(res.Success, "Getting schedule sets with null ConnectionServerRest did not fail"); }
private static WebCallResult <T> GetResult <T>(WebCallResult <CoinExApiResult <T> > result) where T : class { if (result.Error != null || result.Data == null) { return(WebCallResult <T> .CreateErrorResult(result.ResponseStatusCode, result.ResponseHeaders, result.Error)); } return(new WebCallResult <T>(result.ResponseStatusCode, result.ResponseHeaders, result.Data.Data, null)); }
private PortGroup GetPortGroup() { List <PortGroup> oPortGroups; WebCallResult res = PortGroup.GetPortGroups(_connectionServer, out oPortGroups); Assert.IsTrue(res.Success, "Fetching port groups failed:" + res); Assert.IsTrue(oPortGroups.Count > 0, "No port groups found"); return(oPortGroups[0]); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); WebCallResult res = Schedule.AddSchedule(_connectionServer, "Temp_" + Guid.NewGuid().ToString(), _connectionServer.PrimaryLocationObjectId, "", false, out _tempSchedule); Assert.IsTrue(res.Success, "Failed to create new system schedule:" + res); }
private RestrictionTable HelperGetRestrictionTable() { List <RestrictionTable> oTables; WebCallResult res = RestrictionTable.GetRestrictionTables(_connectionServer, out oTables, 1, 2); Assert.IsTrue(res.Success, "Fetching restriction tables failed:" + res); Assert.IsTrue(oTables.Count > 0, "No restriction tables fetched"); return(oTables[0]); }
public void GetNotificationDevices_Success() { List <NotificationDevice> oDevices; //get the notificaiton devices for the operator WebCallResult res = NotificationDevice.GetNotificationDevices(_connectionServer, _tempUser.ObjectId, out oDevices); Assert.IsTrue(res.Success, "Failed to fetch notification devices for operator:" + res); }
private Location GetLocationHelper() { List <Location> oLocations; WebCallResult res = Location.GetLocations(_connectionServer, out oLocations, 1, 10, null); Assert.IsTrue(res.Success, "Failed to fetch list of Locations:" + res); Assert.IsTrue(oLocations.Count > 0, "No locations found in fetch"); return(oLocations[0]); }
public void GetDistributionListMembers_NullConnectionServer_Failure() { List <DistributionListMember> oListMember; WebCallResult res = DistributionListMember.GetDistributionListMembers(null, "", out oListMember); Assert.IsFalse(res.Success, "Fetch of distribution list members should fail with null Connection Server object passed"); }
private WebCallResult <T> EvaluateError <T>(Error error) { if (ThrowThenErrorResponse) { throw new BitGoErrorException(error); } return(WebCallResult <T> .CreateErrorResult(error)); }
private WebCallResult <TOut> Map <TIn, TOut>(WebCallResult <TIn> request) where TIn : AlterDiceBaseResponse <TOut> { if (request) { return(new WebCallResult <TOut>(request.ResponseStatusCode, request.ResponseHeaders, request.Data.Response, request.Error)); } else { return(new WebCallResult <TOut>(request.ResponseStatusCode, request.ResponseHeaders, default, request.Error));
private WebCall(string url, Cookies cookies, string host = null, int? port = null) { Request = (HttpWebRequest)WebRequest.Create(url); Request.Accept = "text/html"; Request.UserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"; Request.CookieContainer = cookies.Container; if (host != null && port != null) Request.Proxy = new WebProxy(host, port.Value); Result = new WebCallResult(url, cookies); }