コード例 #1
0
        public void Can_run_a_script_using_checkin_data()
        {
            // arrange
            var alertMessage  = TestData.DummyCheckInAlertXml();
            var emailProvider = new Moq.Mock <IEmailProvider>();
            var tfsProvider   = new Moq.Mock <ITfsProvider>();
            var sut           = new DslScriptService(emailProvider.Object, tfsProvider.Object, @"dsl\tfs\fullscript.py", @".\dsl");

            // redirect the console
            var consoleOut = Helpers.Logging.RedirectConsoleOut();

            // act
            sut.Notify(alertMessage, string.Empty);

            // assert
            Assert.AreEqual("A checkin event 62" + Environment.NewLine, consoleOut.ToString());
        }
コード例 #2
0
        public void Can_run_a_script_using_build_data()
        {
            // arrange
            var alertMessage  = TestData.DummyBuildStatusChangedAlertXmlWithQualityChange();
            var emailProvider = new Moq.Mock <IEmailProvider>();
            var tfsProvider   = new Moq.Mock <ITfsProvider>();
            var sut           = new DslScriptService(emailProvider.Object, tfsProvider.Object, @"dsl\tfs\fullscript.py", @".\dsl");

            // redirect the console
            var consoleOut = Helpers.Logging.RedirectConsoleOut();

            // act
            sut.Notify(alertMessage, string.Empty);

            // assert
            Assert.AreEqual("A build event vstfs:///Build/Build/49" + Environment.NewLine, consoleOut.ToString());
        }