Пример #1
0
        public void VstsBuildMonitorTest()
        {
            var build = new VSTSBuild_v1
            {
                Account        = "production",
                Project        = "Demo",
                DefinitionName = "Demo-CI",
                Name           = "Test",
                UserName       = string.Empty,
                Password       = "******"
            };

            var monitor = new VstsBuildMonitor();

            monitor.Handle(build);

            Assert.AreEqual(State.Ok, build.State);
        }
Пример #2
0
        public async Task VstsBuildHealthCheckTest()
        {
            var build = new VSTSBuild_v1
            {
                Account        = "production",
                Project        = "Demo",
                DefinitionName = "Demo-CI",
                Name           = "Test",
                UserName       = string.Empty,
                Password       = "******"
            };

            var handler = new VstsBuildHealthCheck();

            var request = HealthCheckRequest.Create(build);

            await handler.Handle(request, CancellationToken.None).ConfigureAwait(false);
        }
Пример #3
0
        public void OpenInBrowserTest()
        {
            var processstarter = Substitute.For <IProcessStarter>();

            var vstsBuild = new VSTSBuild_v1
            {
                Account      = "account",
                Project      = "project",
                DefinitionId = 1
            };

            var openVstsBuildPage = new OpenVstsBuildPage(processstarter);

            openVstsBuildPage.Handle(vstsBuild);

            var expected = "https://account.visualstudio.com/project/_build/index?definitionId=1&_a=completed";

            processstarter.Received().Start(expected);
        }
Пример #4
0
        public async Task OpenVstsBuildWebPageWithSpacesInProjectName()
        {
            var ps = Substitute.For <IProcessStarter>();

            var build = new VSTSBuild_v1
            {
                Account      = "account",
                Project      = "project with spaces",
                DefinitionId = 1
            };

            var request = OpenWebPageRequest.Create(build);

            var handler = new OpenVstsBuildPage(ps);

            await handler.Handle(request, CancellationToken.None);

            const string expected = "https://account.visualstudio.com/project%20with%20spaces/_build/index?definitionId=1&_a=completed";

            ps.Received().Start(expected);
        }