Exemplo n.º 1
0
        public async void Can_get_status_of_task()
        {
            // arrange
            var p = new
            {
                pat          = TestFactory.GetPAT(),
                organization = "richardfennell",
                taskguid     = "6b42ca94-dc11-43dd-8b25-fcbf378b6b89",
                version      = "2.2.11"
            };

            // act
            var request  = TestFactory.CreateHttpRequest(p);
            var response = (OkObjectResult)await ExtensionGate.RunCheckExtensionAvailable(request, logger);

            // assert
            Assert.Equal("{ deployed = True }", response.Value.ToString());
        }
Exemplo n.º 2
0
        public async void Cannot_run_function_with_no_params()
        {
            // arrange
            var p = new
            {
                pat          = "",
                organization = "",
                taskguid     = "",
                version      = ""
            };

            // act
            var request  = TestFactory.CreateHttpRequest(p);
            var response = (BadRequestObjectResult)await ExtensionGate.RunCheckExtensionAvailable(request, logger);

            // assert
            Assert.Equal("Please pass a Azure DevOps instance name, PAT and TaskGuid in the request body", response.Value);
        }