public void ReturnsCorrectLogNamesFromCorrectProjectOnCorrectServer()
        {
            string[]       buildNames = new string[] { "log1", "log2" };
            MockRepository mocks      = new MockRepository(MockBehavior.Default);
            ServerAggregatingCruiseManagerWrapper serverWrapper = InitialiseServerWrapper(mocks,
                                                                                          delegate(CruiseServerClientBase manager)
            {
                Mock.Get(manager).Setup(_manager => _manager.GetBuildNames(It.IsAny <string>()))
                .Returns(buildNames);
            });

            Assert.AreEqual(new DefaultBuildSpecifier(projectSpecifier, "log1"),
                            serverWrapper.GetBuildSpecifiers(projectSpecifier, null)[0]);
            Assert.AreEqual(new DefaultBuildSpecifier(projectSpecifier, "log2"),
                            serverWrapper.GetBuildSpecifiers(projectSpecifier, null)[1]);
        }
Ejemplo n.º 2
0
        public void ReturnsCorrectLogNamesFromCorrectProjectOnCorrectServer()
        {
            string[]       buildNames = new string[] { "log1", "log2" };
            MockRepository mocks      = new MockRepository();
            ServerAggregatingCruiseManagerWrapper serverWrapper = InitialiseServerWrapper(mocks,
                                                                                          delegate(CruiseServerClientBase manager)
            {
                SetupResult.For(manager.GetBuildNames(null))
                .IgnoreArguments()
                .Return(buildNames);
            });

            mocks.ReplayAll();
            Assert.AreEqual(new DefaultBuildSpecifier(projectSpecifier, "log1"),
                            serverWrapper.GetBuildSpecifiers(projectSpecifier, null)[0]);
            Assert.AreEqual(new DefaultBuildSpecifier(projectSpecifier, "log2"),
                            serverWrapper.GetBuildSpecifiers(projectSpecifier, null)[1]);
        }