public void ShouldNotFailWhenMetricsIsInstalled()
        {
            if (!this.MetricsInstalled)
            {
                Assert.IsTrue(true);
                return;
            }

            var mock = new Moq.Mock <IMetricsLogger>();

            // Create a WorkflowInvoker and add the IBuildDetail Extension
            var target = MetricsInvoker.Create(new List <string> {
                "*.dll"
            }, @"c:\binaries", "Metrics.exe", mock.Object);

            Assert.IsNotNull(target);
            mock.Verify(m => m.LogError(Moq.It.IsAny <string>()), Moq.Times.Never());
        }
        public void ShouldFailWhenMetricsNotInstalled()
        {
            if (this.MetricsInstalled)
            {
                Assert.IsTrue(true);
                return;
            }

            var mock = new Moq.Mock <IMetricsLogger>();

            // Create a WorkflowInvoker and add the IBuildDetail Extension
            var target = MetricsInvoker.Create(new List <string> {
                "*.dll"
            }, @"c:\binaries", "Metrics.exe", mock.Object);

            Assert.IsNull(target);
            mock.Verify(m => m.LogError(Moq.It.Is <string>(s => s.Contains("Could not locate"))));
        }
        public void ShouldCreateProperArguments()
        {
            if (!this.MetricsInstalled)
            {
                Assert.IsTrue(true);
                return;
            }

            const string RootPath = @"c:\binaries";
            const string Output   = "MetricsOutput.xml";

            var mock = new Moq.Mock <IMetricsLogger>();

            // Create a WorkflowInvoker and add the IBuildDetail Extension
            var target = MetricsInvoker.Create(new List <string> {
                "*.dll", "*.exe"
            }, RootPath, Output, mock.Object);

            Assert.IsNotNull(target);
            Assert.AreEqual(string.Format("/f:\"{0}\\*.dll\" /f:\"{0}\\*.exe\" /out:\"{1}\"", RootPath, Output), target.Argument);
        }