Beispiel #1
0
        public async Task ProcessingSample2PayloadTest()
        {
            //Arrange
            JObject  payload = ReadJSON(@"/Sample/sample2.json");
            CodeRepo code    = new CodeRepo();

            //Act
            PullRequest pr = await code.ProcessPullRequest(payload, ClientId, ClientSecret, TenantId, SubscriptionId, ResourceGroupName);

            //Assert
            Assert.IsTrue(pr != null);
            Assert.AreEqual(467, pr.Id);
            Assert.AreEqual("completed", pr.Status);
            Assert.AreEqual("Upgraded to Dapper. Testing performance is terrible for some reason", pr.Title);
        }
Beispiel #2
0
        public async Task ProcessingSamplePayloadTest()
        {
            //Arrange
            JObject  payload = ReadJSON(@"/Sample/sample.json");
            CodeRepo code    = new CodeRepo();

            //Act
            PullRequest pr = await code.ProcessPullRequest(payload, ClientId, ClientSecret, TenantId, SubscriptionId, ResourceGroupName);

            //Assert
            Assert.IsTrue(pr != null);
            Assert.AreEqual(1, pr.Id);
            Assert.AreEqual("completed", pr.Status);
            Assert.AreEqual("my first pull request", pr.Title);
        }
Beispiel #3
0
        public async Task ProcessingEmptyPayloadTest()
        {
            //Arrange
            JObject  payload = ReadJSON(@"/Sample/emptySample.json");
            CodeRepo code    = new CodeRepo();

            //Act
            try
            {
                PullRequest pr = await code.ProcessPullRequest(payload, ClientId, ClientSecret, TenantId, SubscriptionId, ResourceGroupName);
            }
            catch (Exception ex)
            {
                //Assert
                Assert.IsTrue(ex.ToString() != "");
            }
        }