private void TestEventAdded(StatisticsLoggerStub stub, LogEvent ev, string eventtype)
        {
            Settings settings = new Settings();
            settings.BasePath = @"c:\";

            ev(settings);

            XmlDocument result = stub.XmlDocument;

            string xpath = string.Format("timestamps/timestamp/event[@type='{0}']", eventtype);
            XmlNodeList nodes = result.SelectNodes(xpath);

            Assert.AreEqual(1, nodes.Count);

            Assert.IsTrue(stub.IsSaved);
        }
        public void LogEvent_BuildFailure_AddEvent_EvellntAdded()
        {
            Settings settings = new Settings();
            settings.BasePath = @"c:\";

            StatisticsLoggerStub stub = new StatisticsLoggerStub();
            
            ProcessResult r = new ProcessResult();
            r.TestResults.CoveredAssemblies = new CoveredAssemblySet();
            CoveredAssembly assembly = new CoveredAssembly();
            assembly.Name = "thename";
            r.TestResults.CoveredAssemblies.Add(assembly);
            
            stub.LogStatistics(settings, r);

            Assert.AreEqual(1, stub.XmlDocument.SelectNodes("timestamps/timestamp/assembly[@id='thename']").Count);
            Assert.IsTrue(stub.IsSaved);
        }
 public void LogEvent_BuildSuccess_AddEvent_EventAdded()
 {
     StatisticsLoggerStub stub = new StatisticsLoggerStub();
     TestEventAdded(stub, stub.LogEvent_BuildSuccess, "buildsuccess");
 }
 public void LogEvent_BuildFailure_AddEvent_EventAdded()
 {
     StatisticsLoggerStub stub = new StatisticsLoggerStub();
     TestEventAdded(stub, stub.LogEvent_BuildFailure, "buildfailure");
 }
 public void LogEvent_StartTimer_AddEvent_EventAdded()
 {
     StatisticsLoggerStub stub = new StatisticsLoggerStub();
     TestEventAdded(stub, stub.LogEvent_StartTimer, "starttimer");
 }