public CCTrayProject[] GetProjectList(BuildServer server, bool newServer)
        {
            if (newServer)
            {
                // Clear the cache when adding a new server
                clientFactory.ResetCache(server.Url);
            }

            ICruiseServerManager manager;
            switch (server.Transport)
            {
                case BuildServerTransport.Remoting:
                    {
                        var client = GenerateRemotingClient(server);
                        manager = new RemotingCruiseServerManager(client, server);
                        break;
                    }

                case BuildServerTransport.Extension:
                    return new ExtensionTransportProjectListRetriever(server.ExtensionName).GetProjectList(server);
                default:
                    {
                        var client = GenerateHttpClient(server);
                        manager = new HttpCruiseServerManager(client, server);
                        break;
                    }
            }

            if (!string.IsNullOrEmpty(server.SecurityType))
            {
                manager.Login();
            }

            return manager.GetProjectList();
        }
		public void SetUp()
		{
			cruiseManagerMock = mocks.StrictMock<CruiseServerClientBase>();

			buildServer = new BuildServer(ServerUrl);
			manager = new RemotingCruiseServerManager(cruiseManagerMock, buildServer);
		}
        public CCTrayProject[] GetProjectList(BuildServer server, bool newServer)
        {
            if (newServer)
            {
                // Clear the cache when adding a new server
                clientFactory.ResetCache(server.Url);
            }

            ICruiseServerManager manager;

            switch (server.Transport)
            {
            case BuildServerTransport.Remoting:
            {
                var client = GenerateRemotingClient(server);
                manager = new RemotingCruiseServerManager(client, server);
                break;
            }

            case BuildServerTransport.Extension:
                return(new ExtensionTransportProjectListRetriever(server.ExtensionName).GetProjectList(server));

            default:
            {
                var client = GenerateHttpClient(server);
                manager = new HttpCruiseServerManager(client, server);
                break;
            }
            }

            if (!string.IsNullOrEmpty(server.SecurityType))
            {
                manager.Login();
            }

            return(manager.GetProjectList());
        }