public void TestShouldRunIntegrationAllowedByExclusionFilter()
        {
            ProjectForceFilter TestSubject = new ProjectForceFilter();

            TestSubject.ProjectFilters = new ProjectFilterList();

            ProjectFilter Project = new ProjectFilter();

            Project.Project = "TestProject";
            Project.ServerUri = "TestUri";

            Project.ExclusionFilters.Activities = new ProjectActivity[2] { ProjectActivity.Building, ProjectActivity.CheckingModifications };
            Project.ExclusionFilters.Conditions = new IntegrationStatus[1] { IntegrationStatus.Failure };

            RecorderIRemotingService RemotingRecorder = new RecorderIRemotingService();
            RecorderICruiseManager CruiseRecorder = new RecorderICruiseManager();
            ProjectStatus Stati = new ProjectStatus();

            Stati.Name = "TestProject";
            Stati.Activity = ProjectActivity.Sleeping;
            Stati.BuildStatus = IntegrationStatus.Success;

            CruiseRecorder.Recordings.GetProjectStatusRecording.ReturnValue = new ProjectStatus[1] { Stati };
            RemotingRecorder.Recordings.ConnectTypeStringRecording.ReturnValue = CruiseRecorder;
            Project.RemoteService = RemotingRecorder;

            TestSubject.ProjectFilters.Add(Project);

            bool Condition = TestSubject.ShouldRunIntegration(null, null);

            Assert.IsTrue(RemotingRecorder.Recordings.ConnectTypeStringRecording.Called);
            Assert.AreEqual("TestUri", RemotingRecorder.Recordings.ConnectTypeStringRecording.PassedStringuri);
            Assert.AreEqual(typeof(ICruiseManager), RemotingRecorder.Recordings.ConnectTypeStringRecording.PassedTypeproxyType);

            Assert.IsTrue(CruiseRecorder.Recordings.GetProjectStatusRecording.Called);

            Assert.IsTrue(Condition);
        }
        public void TestSerialization()
        {
            ProjectForceFilter TestSubject = new ProjectForceFilter();

            TestSubject.ProjectFilters = new ProjectFilterList();
            ((IList)TestSubject.ProjectFilters).Add(new ProjectFilter());
            TestSubject.ProjectFilters[0].ExclusionFilters.Conditions = new IntegrationStatus[1] { IntegrationStatus.Failure };
            TestSubject.ProjectFilters[0].ExclusionFilters.Activities = new ProjectActivity[2] { ProjectActivity.Building, ProjectActivity.CheckingModifications };

            TestSubject.ProjectFilters[0].Project = "experimental1";
            TestSubject.ProjectFilters[0].ServerUri = "tcp://localhost:21247/CruiseManager.rem";

            string Serialized = Zation.Serialize("projectForceFilter", TestSubject);

            Assert.IsNotNull(Serialized);

            ProjectForceFilter Clone = (ProjectForceFilter)Zation.Deserialize(Serialized);

            Assert.In(ProjectActivity.Building, Clone.ProjectFilters[0].ExclusionFilters.Activities);
            Assert.In(ProjectActivity.CheckingModifications, Clone.ProjectFilters[0].ExclusionFilters.Activities);
            Assert.In(IntegrationStatus.Failure, Clone.ProjectFilters[0].ExclusionFilters.Conditions);
            Assert.AreEqual("experimental1", Clone.ProjectFilters[0].Project);
            Assert.AreEqual("tcp://localhost:21247/CruiseManager.rem", Clone.ProjectFilters[0].ServerUri);
        }
        public void TestRequiresClientInformation()
        {
            ProjectForceFilter TestSubject = new ProjectForceFilter();

            Assert.IsFalse(TestSubject.RequiresClientInformation);
        }