public void ReturnsListOfProjectsFromProjectsAndQueuesXml()
        {
            DashboardXmlParser parser = new DashboardXmlParser();

            string[] names = parser.ExtractProjectNames(CRUISE_SERVER_XML);
            Assert.AreEqual(2, names.Length);
            Assert.AreEqual("SvnTest", names[0]);
            Assert.AreEqual("projectName", names[1]);
        }
		public void ReturnsCorrectProjectDetailsFromProjectsOnlyXml()
		{
			DashboardXmlParser parser = new DashboardXmlParser();
			
			CruiseServerSnapshot snapshot = parser.ExtractAsCruiseServerSnapshot(PROJECTS_XML);
			Assert.IsNotNull(snapshot);

            Assert.AreEqual(2, snapshot.ProjectStatuses.Length);
		    AssertProjectsSerializedCorrectly(snapshot);
		}
        public void ReturnsCorrectProjectDetailsFromProjectsAndQueuesXml()
        {
            DashboardXmlParser parser = new DashboardXmlParser();

            CruiseServerSnapshot snapshot = parser.ExtractAsCruiseServerSnapshot(CRUISE_SERVER_XML);
            Assert.IsNotNull(snapshot);

            Assert.AreEqual(2, snapshot.ProjectStatuses.Length);
            AssertProjectsSerializedCorrectly(snapshot);

            Assert.AreEqual(2, snapshot.QueueSetSnapshot.Queues.Count);
            QueueSnapshot queueSnapshot1 = snapshot.QueueSetSnapshot.Queues[0];
            Assert.AreEqual("Queue1", queueSnapshot1.QueueName);
            Assert.AreEqual("projectName", queueSnapshot1.Requests[0].ProjectName);
            Assert.AreEqual(ProjectActivity.CheckingModifications, queueSnapshot1.Requests[0].Activity);
            Assert.AreEqual("SVNTest", queueSnapshot1.Requests[1].ProjectName);
            Assert.AreEqual(ProjectActivity.Pending, queueSnapshot1.Requests[1].Activity);

            QueueSnapshot queueSnapshot2 = snapshot.QueueSetSnapshot.Queues[1];
            Assert.AreEqual("Queue2", queueSnapshot2.QueueName);
            Assert.AreEqual("Missing", queueSnapshot2.Requests[0].ProjectName);
            Assert.AreEqual(ProjectActivity.Building, queueSnapshot2.Requests[0].Activity);
        }