コード例 #1
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);
            }
        }