public void WhenRequestingACruiseProjectManagerWithAnExtensionProtocolValidExtension() { var server = new BuildServer("http://somethingOrOther", BuildServerTransport.Extension, "ThoughtWorks.CruiseControl.UnitTests.CCTrayLib.Monitoring.ExtensionProtocolStub,ThoughtWorks.CruiseControl.UnitTests",string.Empty); var mockCruiseManagerFactory = mocks.StrictMock<ICruiseServerClientFactory>(); var factory = new CruiseProjectManagerFactory(mockCruiseManagerFactory); var serverManagers = new Dictionary<BuildServer, ICruiseServerManager>(); mocks.ReplayAll(); var manager = factory.Create(new CCTrayProject(server, ProjectName), serverManagers); Assert.AreEqual(ProjectName, manager.ProjectName); mocks.VerifyAll(); }
public void WhenRequestingACruiseProjectManagerWithAnHttpUrlConstructsANewDashboardCruiseProjectManager() { var serverAddress = "http://somethingOrOther"; var server = new BuildServer(serverAddress); var client = mocks.DynamicMock<CruiseServerClientBase>(); var clientFactory = mocks.StrictMock<ICruiseServerClientFactory>(); Expect.Call(clientFactory.GenerateHttpClient(serverAddress, new ClientStartUpSettings())) .Constraints(new Equal(serverAddress), new Anything()) .Return(client); var factory = new CruiseProjectManagerFactory(clientFactory); var serverManagers = new Dictionary<BuildServer, ICruiseServerManager>(); serverManagers[server] = new HttpCruiseServerManager(client, server); mocks.ReplayAll(); var manager = factory.Create(new CCTrayProject(server, ProjectName), serverManagers); Assert.AreEqual(ProjectName, manager.ProjectName); Assert.AreEqual(typeof(HttpCruiseProjectManager), manager.GetType()); mocks.VerifyAll(); }