public void AddPortGroupServer_EmptyObjectId_Failure() { PortGroupServer oServer; var res = PortGroupServer.AddPortGroupServer(_mockServer, "", 100, "10.20.30.40", "", out oServer); Assert.IsFalse(res.Success, "Static call to AddPortGroupServer did not fail with empty objectId"); }
public void GetPortGroupServer_NullConnectionServer_Failure() { PortGroupServer oPortGroupServer; var res = PortGroupServer.GetPortGroupServer(out oPortGroupServer, null, "objectid", "portgroupobjectid"); Assert.IsFalse(res.Success, "Static call to GetPortGroupServer did not fail with null ConnectionServer"); }
public void GetPortGroupServer_InvalidObjectId_Failure() { PortGroupServer oPortGroupServer; var res = PortGroupServer.GetPortGroupServer(out oPortGroupServer, _connectionServer, "objectid", "portgroupobjectid"); Assert.IsFalse(res.Success, "Static call to GetPortGroupServer did not fail with invalid ObjectId"); }
public void GetPortGroupServers_NullConnectionServer_Failure() { List <PortGroupServer> oList; WebCallResult res = PortGroupServer.GetPortGroupServers(null, "", out oList); Assert.IsFalse(res.Success, "Static call to GetPortGroupTemplates did not fail with: null ConnectionServer"); }
public void PhoneSystem_ServerTests() { //check servers List <PortGroupServer> oPortGroupServers; WebCallResult res = PortGroupServer.GetPortGroupServers(_connectionServer, _portGroup.ObjectId, out oPortGroupServers); Assert.IsTrue(res.Success, "Failed to fetch port group servers from port group:" + res); Assert.IsTrue(oPortGroupServers.Count > 0, "No port group servers found in port group:" + res); //add servers PortGroupServer oPortGroupServer; res = PortGroupServer.AddPortGroupServer(_connectionServer, _portGroup.ObjectId, 101, _connectionServer.ServerName, "", out oPortGroupServer); Assert.IsTrue(res.Success, "Failed to add new port group server to port group servers from port group:" + res); Console.WriteLine(oPortGroupServer.ToString()); Console.WriteLine(oPortGroupServer.DumpAllProps()); oPortGroupServer.Port = 1234; res = oPortGroupServer.Update(); Assert.IsTrue(res.Success, "Failed to update port group server:" + res); //Deletes res = oPortGroupServer.Delete(); Assert.IsTrue(res.Success, "Failed to delete port group server:" + res); }
public void GetPortGroupServer_EmptyPortGroupObjectId_Failure() { PortGroupServer oPortGroupServer; var res = PortGroupServer.GetPortGroupServer(out oPortGroupServer, _mockServer, "bogus", ""); Assert.IsFalse(res.Success, "Static call to GetPortGroupServer did not fail with empty portgroupObjectId"); }
public void GetPortGroupServers_EmptyPortGroupObjectId_Failure() { List <PortGroupServer> oList; var res = PortGroupServer.GetPortGroupServers(_mockServer, "", out oList); Assert.IsFalse(res.Success, "Static call to GetPortGroupTemplates did not fail with: empty objectId"); }
public void Constructor_EmptyObjectId_Success() { BaseUnitTests.Reset(); PortGroupServer oTemp = new PortGroupServer(_mockServer, "PortGroupId", ""); Console.WriteLine(oTemp.DumpAllProps()); Console.WriteLine(oTemp.ToString()); }
public void PropertyGetFetch_DisplayName() { PortGroupServer oServer = new PortGroupServer(); const string expectedValue = "Test string"; oServer.DisplayName = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("DisplayName", expectedValue), "DisplayName value get fetch failed"); }
public void PropertyGetFetch_Port() { PortGroupServer oServer = new PortGroupServer(); const int expectedValue = 123; oServer.Port = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("Port", expectedValue), "Port value get fetch failed"); }
public void PropertyGetFetch_TlsPort() { PortGroupServer oServer = new PortGroupServer(); const string expectedValue = "Test string"; oServer.TlsPort = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("TlsPort", expectedValue), "TlsPort value get fetch failed"); }
public void PropertyGetFetch_Precedence() { PortGroupServer oServer = new PortGroupServer(); const string expectedValue = "Test string"; oServer.Precedence = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("Precedence", expectedValue), "Precedence value get fetch failed"); }
public void PropertyGetFetch_MediaPortGroupObjectId() { PortGroupServer oServer = new PortGroupServer(); const string expectedValue = "Test string"; oServer.MediaPortGroupObjectId = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("MediaPortGroupObjectId", expectedValue), "MediaPortGroupObjectId value get fetch failed"); }
public void PropertyGetFetch_HostOrIpAddressV6() { PortGroupServer oServer = new PortGroupServer(); const string expectedValue = "Test string"; oServer.HostOrIpAddressV6 = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("HostOrIpAddressV6", expectedValue), "HostOrIpAddressV6 value get fetch failed"); }
public void Update_NoPendingChanges_Failure() { BaseUnitTests.Reset(); PortGroupServer oServer = new PortGroupServer(_mockServer, "PortGroupObjectId"); var res = oServer.Update(); Assert.IsFalse(res.Success, "Calling Update with no pending chnages should fail"); }
public void PropertyGetFetch_SkinnyStateMachineEnum() { PortGroupServer oServer = new PortGroupServer(); const SkinnyStateMachineEnum expectedValue = SkinnyStateMachineEnum.Ccm; oServer.SkinnyStateMachineEnum = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("SkinnyStateMachineEnum", (int)expectedValue), "SkinnyStateMachineEnum value get fetch failed"); }
public void PropertyGetFetch_MediaRemoteServiceEnum() { PortGroupServer oServer = new PortGroupServer(); const MediaRemoteServiceEnum expectedValue = MediaRemoteServiceEnum.CCM; oServer.MediaRemoteServiceEnum = expectedValue; Assert.IsTrue(oServer.ChangeList.ValueExists("MediaRemoteServiceEnum", (int)expectedValue), "MediaRemoteServiceEnum value get fetch failed"); }
public void GetPortGroupServers_InvalidObjectId_Failure() { List <PortGroupServer> oList; var res = PortGroupServer.GetPortGroupServers(_connectionServer, "bogus", out oList); Assert.IsTrue(res.Success, "Fetching port group servers with invalid objectId should not fail"); Assert.IsTrue(oList.Count == 0, "Static call to GetPortGroupTemplates did not fail with: invalid objectId"); }
public void UpdatePortGroupServer_EmptyPortGroupObjectId_Failure() { ConnectionPropertyList oProps = new ConnectionPropertyList(); oProps.Add("Bogus", "invalid"); var res = PortGroupServer.UpdatePortGroupServer(_connectionServer, "portgroupobjectid", "bogus", oProps); Assert.IsFalse(res.Success, "Static call to UpdatePortGroupServer did not fail with an empty property list"); }
public void Constructor_ObjectId_ErrorResponse_Success() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); PortGroupServer oTemp = new PortGroupServer(_mockServer, "PortGroupId", "ObjectId"); }
public void Delete_ErrorResponse_Failure() { PortGroupServer oServer = new PortGroupServer(_mockServer, "PortGroupObjectId"); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.DELETE, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); var res = oServer.Delete(); Assert.IsFalse(res.Success, "Calling Delete with an error response should fail"); }
public void GetPortGroupServers_EmptyResult_Failure() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), It.IsAny <MethodType>(), It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = true, ResponseText = "" }); List <PortGroupServer> oServers; var res = PortGroupServer.GetPortGroupServers(_mockServer, "PortGroupObjectId", out oServers); Assert.IsFalse(res.Success, "Calling GetPortGroupServers with EmptyResultText did not fail"); }
public void RefetchPortGroupServerData_ErrorResponse_Failure() { BaseUnitTests.Reset(); PortGroupServer oServer = new PortGroupServer(_mockServer, "PortGroupObjectId"); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); var res = oServer.RefetchPortGroupServerData(); Assert.IsFalse(res.Success, "Calling RefetchPortGroupServerData with an error response should fail"); }
public void GetPortGroupServer_ErrorResponse_Failure() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); PortGroupServer oServer; var res = PortGroupServer.GetPortGroupServer(out oServer, _mockServer, "ObjectId", "PortGroupObjectId"); Assert.IsFalse(res.Success, "Calling GetPortGroupServer with ErrorResponse did not fail"); }
public void GetPortGroupServers_ZeroCount_Success() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = true, ResponseText = "junk text", TotalObjectCount = 0 }); List <PortGroupServer> oServers; var res = PortGroupServer.GetPortGroupServers(_mockServer, "PortGroupObjectId", out oServers); Assert.IsTrue(res.Success, "Calling GetPortGroupServers with ZeroCount failed:" + res); }
public void GetPortGroupServers_GarbageResponse_Failure() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = true, TotalObjectCount = 1, ResponseText = "garbage result that will not be parsed out as call handler JSON data" }); List <PortGroupServer> oServers; var res = PortGroupServer.GetPortGroupServers(_mockServer, "PortGroupObjectId", out oServers); Assert.IsFalse(res.Success, "Calling GetPortGroupServers with garbage results should fail"); Assert.IsTrue(oServers.Count == 0, "Invalid result text should produce an empty list"); }
public void DeletePortGroupServer_ErrorResponse_Failure() { BaseUnitTests.Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.DELETE, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); ConnectionPropertyList oProps = new ConnectionPropertyList(); oProps.Add("Test", "Test"); var res = PortGroupServer.DeletePortGroupServer(_mockServer, "ObjectId", "PortGroupObjectId"); Assert.IsFalse(res.Success, "Calling DeletePortGroupServer with ErrorResponse did not fail"); }
public void PortGroup_Test() { _errorString = ""; List <PortGroup> oPortGroups; var res = PortGroup.GetPortGroups(_connectionServer, out oPortGroups, 1, 2); Assert.IsTrue(res.Success & oPortGroups.Count > 0, "Failed to fetch port groups:" + res); Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); //PortGroupCodec List <PortGroupCodec> oPortGroupCodecs; res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, oPortGroups[0].ObjectId, out oPortGroupCodecs); Assert.IsTrue(res.Success & oPortGroupCodecs.Count > 0, "Failed to fetch port group codecs:" + res); Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); //PortGroupServer List <PortGroupServer> oPortGroupServers; res = PortGroupServer.GetPortGroupServers(_connectionServer, oPortGroups[0].ObjectId, out oPortGroupServers); Assert.IsTrue(res.Success & oPortGroupServers.Count > 0, "Failed to fetch port group server:" + res); Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); }
public void Constructor_ObjectId_Success() { BaseUnitTests.Reset(); PortGroupServer oTemp = new PortGroupServer(_mockServer, "PortGroupId", "ObjectId"); }
public void Constructor_Default_Success() { BaseUnitTests.Reset(); PortGroupServer oTemp = new PortGroupServer(); }