Exemplo n.º 1
0
        public void InvalidPrNumber()
        {
            DetectRPScopeTask rpScope = new DetectRPScopeTask(NET_SDK_PUB_URL, "-1");

            if (rpScope.Execute())
            {
                Assert.Empty(rpScope.ScopesFromPR);
            }
        }
Exemplo n.º 2
0
        public void NonExistantPrNumber()
        {
            DetectRPScopeTask rpScope = new DetectRPScopeTask(NET_SDK_PUB_URL, "10945356");

            if (rpScope.Execute())
            {
                Assert.Empty(rpScope.ScopesFromPR);
            }
            //Assert.Throws<ArgumentException>(() => rpScope.Execute());
        }
        public void SingleScope(string ghUrl, long ghPrNumber)
        {
            DetectRPScopeTask rpScope = new DetectRPScopeTask(ghUrl, ghPrNumber);

            if (rpScope.Execute())
            {
                switch (ghPrNumber)
                {
                case 6396:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6418:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6419:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6304:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6453:
                {
                    Assert.Null(rpScope.ScopesFromPR);
                    break;
                }

                default:
                {
                    Assert.True(false);
                    break;
                }
                }
            }
            else
            {
                Assert.True(false);
            }
        }
        public void MultipleScopes()
        {
            string            ghUrl      = NET_SDK_PUB_URL;
            long              ghPrNumber = 6499;
            DetectRPScopeTask rpScope    = new DetectRPScopeTask(ghUrl, ghPrNumber);

            if (rpScope.Execute())
            {
                Assert.NotNull(rpScope.ScopesFromPR);
                Assert.True(rpScope.ScopesFromPR.Length > 5);
            }
            else
            {
                Assert.True(false);
            }
        }
Exemplo n.º 5
0
        public void SingleScopeAndCat()
        {
            string            ghUrl      = NET_SDK_PUB_URL;
            int               ghPrNumber = 6804;
            DetectRPScopeTask rpScope    = new DetectRPScopeTask(ghUrl, ghPrNumber.ToString());

            rpScope.Execute();
            Assert.Single(rpScope.ScopesFromPR);

            CategorizeSDKProjectsTask cproj = new CategorizeSDKProjectsTask(rootDir);

            cproj.BuildScope = rpScope.PRScopeString;
            cproj.Execute();

            Assert.Empty(cproj.SDK_Projects);
        }
Exemplo n.º 6
0
        public void PrivateRepoPR()
        {
            string            ghUrl      = NET_SDK_PUB_URL_pr;
            long              ghPrNumber = 923;
            DetectRPScopeTask rpScope    = new DetectRPScopeTask(ghUrl, ghPrNumber.ToString());

            if (rpScope.Execute())
            {
                Assert.Empty(rpScope.ScopesFromPR);
                Assert.True(string.IsNullOrWhiteSpace(rpScope.PRScopeString));
            }
            else
            {
                Assert.True(false);
            }
        }
Exemplo n.º 7
0
        public void MultipleScopes()
        {
            string            ghUrl      = NET_SDK_PUB_URL;
            long              ghPrNumber = 6620;
            DetectRPScopeTask rpScope    = new DetectRPScopeTask(ghUrl, ghPrNumber.ToString());

            if (rpScope.Execute())
            {
                Assert.True(rpScope.ScopesFromPR.Length > 1);
                Assert.True(!string.IsNullOrWhiteSpace(rpScope.PRScopeString));
            }
            else
            {
                Assert.True(false);
            }
        }
Exemplo n.º 8
0
        public void DefaultToBuildEntireMgmtProjects()
        {
            string            ghUrl      = NET_SDK_PUB_URL;
            long              ghPrNumber = 6453; //6606
            DetectRPScopeTask rpScope    = new DetectRPScopeTask(ghUrl, ghPrNumber.ToString());

            if (rpScope.Execute())
            {
                Assert.Empty(rpScope.ScopesFromPR);
                Assert.True(string.IsNullOrWhiteSpace(rpScope.PRScopeString));
            }
            else
            {
                Assert.True(false);
            }
        }
Exemplo n.º 9
0
        public void BuildMgmtProjectsForCertainScopes()
        {
            const string NET_SDK_PUB_URL = @"https://github.com/azure/azure-sdk-for-net";
            //6453 non sdk changes
            DetectRPScopeTask rpScope = new DetectRPScopeTask(NET_SDK_PUB_URL, 6453.ToString());

            rpScope.Execute();

            CategorizeSDKProjectsTask cproj = new CategorizeSDKProjectsTask(rootDir);

            cproj.BuildScopes = rpScope.PRScopeString;

            if (cproj.Execute())
            {
                Assert.True(cproj.SDK_Projects.Count <ITaskItem>() >= 80);
            }
        }
        public void InvalidPrNumber()
        {
            DetectRPScopeTask rpScope = new DetectRPScopeTask(NET_SDK_PUB_URL, -1);

            Assert.Throws <ArgumentException>(() => rpScope.Execute());
        }
Exemplo n.º 11
0
        public void SingleScope(string ghUrl, long ghPrNumber)
        {
            DetectRPScopeTask rpScope = new DetectRPScopeTask(ghUrl, ghPrNumber.ToString());

            if (rpScope.Execute())
            {
                switch (ghPrNumber)
                {
                case 6804:
                {
                    Assert.Single(rpScope.ScopesFromPR);
                    Assert.True(!string.IsNullOrWhiteSpace(rpScope.PRScopeString));
                    break;
                }

                case 6687:
                {
                    Assert.Empty(rpScope.ScopesFromPR);
                    break;
                }

                case 6396:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6418:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6419:
                {
                    Assert.NotNull(rpScope.ScopesFromPR);
                    Assert.True(rpScope.ScopesFromPR.Length == 1);
                    break;
                }

                case 6304:
                {
                    Assert.Single(rpScope.ScopesFromPR);
                    Assert.True(!string.IsNullOrWhiteSpace(rpScope.PRScopeString));
                    break;
                }

                case 6453:
                {
                    Assert.Empty(rpScope.ScopesFromPR);
                    break;
                }

                default:
                {
                    Assert.True(false);
                    break;
                }
                }
            }
            else
            {
                Assert.True(false);
            }
        }