public void PrivateList_Test() { PrivateList oList; var res = PrivateList.AddPrivateList(_connectionServer, _tempUser.ObjectId, "Test list 1", 1, out oList); Assert.IsTrue(res.Success, "Failed to create private list for user:"******"Failed to add member to private list"); _errorString = ""; List <PrivateList> oPrivateLists; res = PrivateList.GetPrivateLists(_connectionServer, _tempUser.ObjectId, out oPrivateLists, 1, 2); Assert.IsTrue(res.Success & oPrivateLists.Count > 0, "Failed to fetch private lists:" + res); Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); //private list member foreach (var oPrivateList in oPrivateLists) { List <PrivateListMember> oPrivateListMembers; res = PrivateList.GetMembersList(_connectionServer, oPrivateList.ObjectId, _tempUser.ObjectId, out oPrivateListMembers); Assert.IsTrue(res.Success & oPrivateLists.Count > 0, "Failed to fetch private list members:" + res); if (oPrivateListMembers.Count > 0) { break; } } Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); //create new list with GUID in the name to ensure uniqueness String strUserAlias = "TempUserPrivList_" + 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:"******"Test Private List1", 1, out _tempPrivateList); Assert.IsTrue(res.Success, "Failed to create new private list for user:" + res); }
public void AddPrivateList_InvalidListNumber_Failure() { var res = PrivateList.AddPrivateList(_connectionServer, _tempPrivateList.ObjectId, "display name", 200); Assert.IsFalse(res.Success, "Adding private list with invalid numeric id did not fail"); }
public void AddPrivateList_InvalidObjectId_Failure() { var res = PrivateList.AddPrivateList(_connectionServer, "objectid", "display name", 1); Assert.IsFalse(res.Success, "Adding private list with invalid UserObjectId did not fail"); }
public void AddPrivateList_BlankObjectId_Failure() { var res = PrivateList.AddPrivateList(_mockServer, "OwnerObjectId", "", 1); Assert.IsFalse(res.Success, "Adding private list with blank display name did not fail"); }
public void AddPrivateList_NullConnectionServer_Failure() { var res = PrivateList.AddPrivateList(null, "OwnerObjectId", "ObjectId", 1); Assert.IsFalse(res.Success, "Adding private list with null connection server did not fail"); }