public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); _connectionServer.ErrorEvents += ServerOnErrorEvents; //create new list with GUID in the name to ensure uniqueness String strAlias = "TempUserServerResp_" + Guid.NewGuid().ToString().Replace("-", ""); //generate a random number and tack it onto the end of some zeros so we're sure to avoid any legit numbers on the system. Random random = new Random(); int iExtPostfix = random.Next(100000, 999999); string strExtension = "000000" + iExtPostfix.ToString(); //use a bogus extension number that's legal but non dialable to avoid conflicts var res = UserBase.AddUser(_connectionServer, "voicemailusertemplate", strAlias, strExtension, null, out _tempUser); Assert.IsTrue(res.Success, "Failed creating temporary user:"******"TempContactJsn_" + Guid.NewGuid().ToString().Replace("-", ""); res = Contact.AddContact(_connectionServer, "systemcontacttemplate", strAlias, "", "", strAlias, null, out _tempContact); Assert.IsTrue(res.Success, "Failed creating temporary contact:" + res.ToString()); strAlias = "TempInterviewer_" + Guid.NewGuid().ToString().Replace("-", ""); res = InterviewHandler.AddInterviewHandler(_connectionServer, strAlias, _tempUser.ObjectId, "", null, out _tempInterviewer); Assert.IsTrue(res.Success, "Failed creating temporary interviewer:" + res.ToString()); strAlias = "TempRecording_" + Guid.NewGuid().ToString().Replace("-", ""); res = PostGreetingRecording.AddPostGreetingRecording(_connectionServer, strAlias, out _tempRecording); Assert.IsTrue(res.Success, "Failed creating temporary post greeting recording:" + res.ToString()); }
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); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); WebCallResult res = UserTemplate.AddUserTemplate(_connectionServer, "voicemailusertemplate", "test" + Guid.NewGuid().ToString(), "test_" + Guid.NewGuid().ToString(), null, out _userTemplate); Assert.IsTrue(res.Success, "Failed to create new User Template:" + res); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); _connectionServer.ErrorEvents += ServerOnErrorEvents; string strAlias = "Tenant" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 13); var res = Tenant.AddTenant(_connectionServer, strAlias, strAlias + ".org", strAlias, "", "", out _tempTenant); Assert.IsTrue(res.Success, "Failed to create temproary teannt:" + res); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new handler with GUID in the name to ensure uniqueness String strName = "TempRule_" + Guid.NewGuid().ToString().Replace("-", ""); WebCallResult res = RoutingRule.AddRoutingRule(_connectionServer, strName, null, out _tempRule); Assert.IsTrue(res.Success, "Failed creating temporary routing rule:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new handler with GUID in the name to ensure uniqueness String strName = "Tenant" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 8); WebCallResult res = Tenant.AddTenant(_connectionServer, strName, strName + ".org", strName, "", "", out _tempTenant); Assert.IsTrue(res.Success, "Failed creating temporary tenant:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new contact with GUID in the name to ensure uniqueness String strName = "TempContact_" + Guid.NewGuid().ToString().Replace("-", ""); WebCallResult res = Contact.AddContact(_connectionServer, "systemcontacttemplate", strName, "", "", strName, null, out _tempContact); Assert.IsTrue(res.Success, "Failed creating temporary contact:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); var res = CreateTemplateHandler(); if (res.Success == false) { throw new Exception("Failed to create template handler to start CallHandlerTemplate test"); } }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //get a call handler to use for various tests in this class - the opening greeting should always be there WebCallResult res = CallHandler.GetCallHandler(out _callHandler, _connectionServer, "", "opening greeting"); if (res.Success == false | _callHandler == null) { throw new Exception("Unable to get opening greeting call handler for test functions in GreetingIntegrationTests"); } }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //get call handler to do real tests WebCallResult res = CallHandler.GetCallHandler(out _callHandler, _connectionServer, "", "Opening Greeting"); if (res.Success == false | _callHandler == null) { throw new Exception("Uanble to fetch Opening Greeting call handler for use in testing scenarios"); } }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new greeting with GUID in the name to ensure uniqueness String strName = "TempGreeting_" + Guid.NewGuid().ToString().Replace("-", ""); WebCallResult res = PostGreetingRecording.AddPostGreetingRecording(_connectionServer, strName, out _tempGreeting); Assert.IsTrue(res.Success, "Failed creating temporary interview handler:" + res.ToString()); Assert.IsNotNull(_tempGreeting, "Null temorary greeting passed back"); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); WebCallResult res = PhoneSystem.AddPhoneSystem(_connectionServer, "UnitTest_" + Guid.NewGuid(), out _phoneSystem); Assert.IsTrue(res.Success, "Creating new temporary phone system failed:" + res); res = PortGroup.AddPortGroup(_connectionServer, "UnitTest_" + Guid.NewGuid(), _phoneSystem.ObjectId, _connectionServer.ServerName, TelephonyIntegrationMethodEnum.SIP, "", out _portGroup); Assert.IsTrue(res.Success, "Creating new temporary port group failed:" + res); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); WebCallResult res = ScheduleSet.AddQuickSchedule(_connectionServer, "temp_" + Guid.NewGuid().ToString(), _connectionServer.PrimaryLocationObjectId, "", 0, 200, true, true, true, true, true, false, false); Assert.IsTrue(res.Success, "Failed to create new quick schedule:" + res); res = ScheduleSet.GetScheduleSet(out _tempScheduleSet, _connectionServer, res.ReturnedObjectId); Assert.IsTrue(res.Success, "Failed to find new quick schedule:" + res); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); List <UserBase> tempUser; UserBase.GetUsers(_connectionServer, out tempUser, 1, 1); string strAlias = "TempInterviewer_" + Guid.NewGuid().ToString().Replace("-", ""); var res = InterviewHandler.AddInterviewHandler(_connectionServer, strAlias, tempUser[0].ObjectId, "", null, out _tempInterviewer); Assert.IsTrue(res.Success, "Failed creating temporary interviewer:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); string strName = "Temp_" + Guid.NewGuid().ToString(); WebCallResult res = SearchSpace.AddSearchSpace(_connectionServer, out _searchSpace, strName, "SearchSpace added by Unit Test"); Assert.IsTrue(res.Success, "Creation of new SearchSpace failed"); strName = "Temp_" + Guid.NewGuid().ToString(); res = Partition.AddPartition(_connectionServer, out _partition, strName, "Partition added by Unit Test"); Assert.IsTrue(res.Success, "Creation of new partition failed"); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //grab the first user in the directory to use as a recipient List <UserBase> oUsers; WebCallResult res = UserBase.GetUsers(_connectionServer, out oUsers, 1, 1); Assert.IsTrue(res.Success, "Failed fetching user as recipient for creating temporary interview handler:" + res); //create new handler with GUID in the name to ensure uniqueness String strName = "TempHandler_" + Guid.NewGuid().ToString().Replace("-", ""); res = InterviewHandler.AddInterviewHandler(_connectionServer, strName, oUsers[0].ObjectId, "", null, out _tempHandler); Assert.IsTrue(res.Success, "Failed creating temporary interview handler:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new list with GUID in the name to ensure uniqueness String strUserAlias = "TempUserMbx_" + Guid.NewGuid().ToString().Replace("-", ""); //generate a random number and tack it onto the end of some zeros so we're sure to avoid any legit numbers on the system. Random random = new Random(); int iExtPostfix = random.Next(100000, 999999); string strExtension = "000000" + iExtPostfix.ToString(); //use a bogus extension number that's legal but non dialable to avoid conflicts WebCallResult res = UserBase.AddUser(_connectionServer, "voicemailusertemplate", strUserAlias, strExtension, null, out _tempUser); Assert.IsTrue(res.Success, "Failed creating temporary user:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //grab the first template - should always be one and it doesn't matter which List <CallHandlerTemplate> oTemplates; WebCallResult res = CallHandlerTemplate.GetCallHandlerTemplates(_connectionServer, out oTemplates); if (res.Success == false || oTemplates == null || oTemplates.Count == 0) { Assert.Fail("Could not fetch call handler templates:" + res); } //create new handler with GUID in the name to ensure uniqueness String strName = "TempHandler_" + Guid.NewGuid().ToString().Replace("-", ""); res = CallHandler.AddCallHandler(_connectionServer, oTemplates[0].ObjectId, strName, "", null, out _tempHandler); Assert.IsTrue(res.Success, "Failed creating temporary callhandler:" + res.ToString()); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); Settings mySettings = new Settings(); _extensionToDial = mySettings.ExtensionToDial; if (string.IsNullOrEmpty(_extensionToDial)) { Assert.Fail("No extension defined to run phone recording tests"); return; } try { _recording = new PhoneRecording(_connectionServer, _extensionToDial, 6); } catch (UnityConnectionRestException ex) { Assert.Fail("Phone connection failed to extension:{0}, error={1}", _extensionToDial, ex.WebCallResult); } Assert.IsTrue(_recording.IsCallConnected(), "Call not connected after class creation"); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); }