public void GetsProjectFromCorrectServer()
        {
            string         serializedProject = "a serialized project";
            MockRepository mocks             = new MockRepository(MockBehavior.Default);
            ServerAggregatingCruiseManagerWrapper serverWrapper = InitialiseServerWrapper(mocks,
                                                                                          delegate(CruiseServerClientBase manager)
            {
                Mock.Get(manager).Setup(_manager => _manager.GetProject(It.IsAny <string>()))
                .Returns(serializedProject);
            });

            // Execute
            string returnedProject = serverWrapper.GetProject(projectSpecifier, null);

            // Verify
            Assert.AreEqual(serializedProject, returnedProject);
        }
Beispiel #2
0
        public void GetsProjectFromCorrectServer()
        {
            string         serializedProject = "a serialized project";
            MockRepository mocks             = new MockRepository();
            ServerAggregatingCruiseManagerWrapper serverWrapper = InitialiseServerWrapper(mocks,
                                                                                          delegate(CruiseServerClientBase manager)
            {
                SetupResult.For(manager.GetProject(null))
                .IgnoreArguments()
                .Return(serializedProject);
            });

            mocks.ReplayAll();

            // Execute
            string returnedProject = serverWrapper.GetProject(projectSpecifier, null);

            // Verify
            Assert.AreEqual(serializedProject, returnedProject);
        }