コード例 #1
0
        public IList <IReportItem> GetData(ITestManagementTeamProject teamProject, IUriFactory uriFactory, uint testItemID, CancellationToken cancellationToken, IProgress <string> progress)
        {
            ReportProgress(progress, $"Looking for test plan with ID {testItemID} ...");
            var testPlan = teamProject.TestPlans.Find((int)testItemID);

            if (testPlan == null)
            {
                ReportProgress(progress, $"Test plan with ID {testItemID} not found ...");
                Thread.Sleep(500);

                ReportProgress(progress, $"Trying to find test suite with ID {testItemID} ...");
                var testSuite = teamProject.TestSuites.Find((int)testItemID);
                if (testSuite == null)
                {
                    ReportProgress(progress, $"Test suite with ID {testItemID} not found ...");
                    Thread.Sleep(500);
                    return(new List <IReportItem>(0));
                }

                if (!(testSuite is IStaticTestSuite staticTestSuite))
                {
                    return(new List <IReportItem>(0));
                }

                return(new List <IReportItem> {
                    LoadTestSuite(teamProject, uriFactory, staticTestSuite, cancellationToken, progress)
                });
            }
            else
            {
                return(new List <IReportItem> {
                    LoadTestPlan(teamProject, uriFactory, testPlan, cancellationToken, progress)
                });
            }
        }
コード例 #2
0
ファイル: Resource.cs プロジェクト: anthrax3/LinqToRest
 public Resource(string name, IRestQueryableFactory restQueryableFactory, IHttpService httpService, IUriFactory uriFactory)
 {
     _name = name;
     _restQueryableFactory = restQueryableFactory;
     _httpService          = httpService;
     _uriFactory           = uriFactory;
 }
コード例 #3
0
 public IList <IReportItem> GetData(ITestManagementTeamProject teamProject, IUriFactory uriFactory, uint testSuiteID, CancellationToken cancellationToken, IProgress <string> progress)
 {
     return(new List <IReportItem> {
         new TestPlan(0, 0, "Regression dummy test plan", new List <IReportItem>
         {
             CreateTestSuite(1, 0,
                             new List <IReportItem>
             {
                 //CreateTestCase(14, 0),
                 CreateTestSuite(11, 1, new List <IReportItem>
                 {
                     CreateTestCase(111, 11),
                     CreateTestCase(112, 11),
                     CreateTestCase(113, 11),
                 }),
                 CreateTestCase(12, 0),
                 CreateTestCase(13, 0),
                 CreateTestCase(14, 0),
                 CreateTestCase(15, 0),
                 CreateTestCase(16, 0),
                 CreateTestCase(17, 0),
                 CreateTestCase(18, 0),
                 CreateTestCase(19, 0),
                 CreateTestCase(20, 0),
             }),
             CreateTestSuite(2, 0, new List <IReportItem>
             {
                 CreateTestSuite(21, 2, new List <IReportItem>()
                 {
                     CreateTestCase(211, 21),
                     CreateTestCase(212, 21)
                 }),
                 CreateTestSuite(22, 2, new List <IReportItem>
                 {
                     CreateTestCase(221, 22)
                 })
             }),
             CreateTestSuite(3, 0, new List <IReportItem>
             {
                 CreateTestSuite(31, 3),
                 CreateTestSuite(32, 3),
                 CreateTestSuite(33, 3, new List <IReportItem>
                 {
                     CreateTestCase(331, 33)
                 }),
             }),
             CreateTestSuite(4, 0, new List <IReportItem>
             {
                 CreateTestSuite(41, 4),
                 CreateTestSuite(42, 4),
                 CreateTestSuite(43, 4, new List <IReportItem>
                 {
                     CreateTestCase(431, 43)
                 }),
             })
         }, new Uri("http://www.google.com"))
     });
 }
コード例 #4
0
        private IReportItem LoadTestSuite(ITestManagementTeamProject teamProject, IUriFactory uriFactory, IStaticTestSuite rootTestSuite, CancellationToken cancellationToken, IProgress <string> progress)
        {
            var testSuite = new TestSuite(rootTestSuite.Id, 0, rootTestSuite.Title, uriFactory.GetTestSuiteUri(rootTestSuite.Id, rootTestSuite.Plan?.Id));

            ReportProgress(progress, $"Loading test suite {rootTestSuite.Id} ...");
            InitializeTestSuite(teamProject, uriFactory, rootTestSuite, testSuite, cancellationToken, progress);

            return(testSuite);
        }
コード例 #5
0
 public TumblrFixture()
 {
     UriFactory = new UriFactory();
     Command    = new CreateTumblrCommand
     {
         UriFactory         = UriFactory,
         TableEntityFactory = new TableEntityFactory(UriFactory)
     };
 }
コード例 #6
0
        // constructors
        public MatchClient(string encryptedAccountId, IUriFactory uriFactory, HttpClient client)
        {
            if (string.IsNullOrEmpty(encryptedAccountId))
            {
                throw new ArgumentException("encryptedAccoundId cannot be null or empty.", nameof(encryptedAccountId));
            }

            _encryptedAccountId = encryptedAccountId;
            _uriFactory         = uriFactory ?? throw new ArgumentNullException(nameof(uriFactory));
            _httpClient         = client ?? throw new ArgumentNullException(nameof(client));
        }
コード例 #7
0
        // constructors
        public SummonerClient(string name, IUriFactory uriFactory, HttpClient httpClient)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("Summoner name cannot be null, empty, or white space.", nameof(name));
            }

            _name       = name;
            _uriFactory = uriFactory ?? throw new ArgumentNullException(nameof(_uriFactory));
            _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
        }
コード例 #8
0
        // constructors
        public LeagueEntryClient(string encryptedSummonerId, IUriFactory uriFactory, HttpClient httpClient)
        {
            if (string.IsNullOrEmpty(encryptedSummonerId))
            {
                throw new ArgumentException("message", nameof(encryptedSummonerId));
            }

            _encryptedSummonerId = encryptedSummonerId;
            _uriFactory          = uriFactory ?? throw new ArgumentNullException(nameof(uriFactory));
            _httpClient          = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
        }
コード例 #9
0
 public SasCommentService(
     IAzureStorage azureStorage,
     ICommand createCommentCommand,
     ITumblrService tumblrService,
     IUriFactory uriFactory,
     ISasService sasService)
 {
     _azureStorage         = azureStorage;
     _createCommentCommand = createCommentCommand;
     _tumblrService        = tumblrService;
     _uriFactory           = uriFactory;
     _sasService           = sasService;
 }
コード例 #10
0
 public FavoriteService(
     IAzureStorage azureStorage,
     ICommand readEntityCommand,
     ICommand createFavoriteCommand,
     ICommand deleteFavoriteCommand,
     IUriFactory uriFactory)
 {
     _azureStorage          = azureStorage;
     _readEntityCommand     = readEntityCommand;
     _createFavoriteCommand = createFavoriteCommand;
     _deleteFavoriteCommand = deleteFavoriteCommand;
     _uriFactory            = uriFactory;
 }
コード例 #11
0
        private void InitializeTestSuite(ITestManagementTeamProject teamProject, IUriFactory uriFactory, IStaticTestSuite parentStaticTestSuite, IReportItem parentReportItem, CancellationToken cancellationToken, IProgress <string> progress)
        {
            LoadTestCasesForTestSuite(teamProject, uriFactory, parentStaticTestSuite, parentReportItem, cancellationToken, progress);

            foreach (var staticTestSuite in parentStaticTestSuite.SubSuites.OfType <IStaticTestSuite>().OrderBy(suite => suite.Title))
            {
                ReportProgress(progress, $"Loading test suite {staticTestSuite.Id} ...");
                cancellationToken.ThrowIfCancellationRequested();
                var reportTestSuite = new TestSuite(staticTestSuite.Id, parentStaticTestSuite.Id, staticTestSuite.Title, uriFactory.GetTestSuiteUri(staticTestSuite.Id, staticTestSuite.Plan?.Id));
                parentReportItem.Children.Add(reportTestSuite);

                InitializeTestSuite(teamProject, uriFactory, staticTestSuite, reportTestSuite, cancellationToken, progress);
            }
        }
コード例 #12
0
        private IReportItem LoadTestPlan(ITestManagementTeamProject teamProject, IUriFactory uriFactory, ITestPlan rootTestPlan, CancellationToken cancellationToken, IProgress <string> progress)
        {
            var testPlan  = new TestPlan(rootTestPlan.Id, 0, rootTestPlan.Name, uriFactory.GetTestPlanUri(rootTestPlan.Id));
            var rootSuite = rootTestPlan.RootSuite;

            if (rootSuite == null)
            {
                return(testPlan);
            }

            ReportProgress(progress, $"Loading test plan {rootTestPlan.Id} ...");
            InitializeTestSuite(teamProject, uriFactory, rootSuite, testPlan, cancellationToken, progress);
            return(testPlan);
        }
コード例 #13
0
 public FavoriteFixture()
 {
     UriFactory          = new UriFactory();
     CreateTumblrCommand = new CreateTumblrCommand
     {
         UriFactory         = UriFactory,
         TableEntityFactory = new TableEntityFactory(UriFactory)
     };
     CreateFavoriteCommand = new CreateFavoriteCommand
     {
         UriFactory         = UriFactory,
         TableEntityFactory = new TableEntityFactory(UriFactory)
     };
 }
コード例 #14
0
 public FavoriteApiController(IFavoriteService favoriteService, IUriFactory uriFactory)
 {
     _favoriteService = favoriteService;
     _uriFactory      = uriFactory;
 }
コード例 #15
0
 public void TestTearDown()
 {
     _uriFactory = null;
 }
コード例 #16
0
 public void TestSetUp()
 {
     _uriFactory = new UriFactory(new Uri(Url));
 }
コード例 #17
0
        private void LoadTestCasesForTestSuite(ITestManagementTeamProject teamProject, IUriFactory uriFactory, IStaticTestSuite staticParentTestSUite, IReportItem parentReportItem, CancellationToken cancellationToken, IProgress <string> progress)
        {
            var testCases      = staticParentTestSUite.TestCases;
            var actualTestCase = 0;
            var testCasesCount = testCases.Count;

            foreach (var testEntry in testCases)
            {
                actualTestCase++;
                ReportProgress(progress, $"Loading test cases for test suite {staticParentTestSUite.Id} ({actualTestCase}/{testCasesCount}) ...");
                cancellationToken.ThrowIfCancellationRequested();
                var testResult = teamProject.TestResults.ByTestId(testEntry.Id).OrderByDescending(c => c.DateCreated).FirstOrDefault();
                if (testResult == null)
                {
                    parentReportItem.Children.Add(
                        new TestCase(
                            testEntry.Id,
                            staticParentTestSUite.Id,
                            testEntry.Title,
                            testEntry.TestCase?.Description.HtmlToPlainText()));
                }
                else
                {
                    var testCaseUri = IsValidTestOutcome(testResult) ? uriFactory.GetTestCaseUri(testEntry.Id) : null;
                    var testRunUri  = IsValidTestOutcome(testResult) ? uriFactory.GetTestRunUri(testResult.TestRunId, testResult.TestResultId) : null;

                    parentReportItem.Children.Add(
                        new TestCase(
                            testEntry.Id,
                            staticParentTestSUite.Id,
                            testEntry.Title,
                            testEntry.TestCase?.Description.HtmlToPlainText(),
                            testResult.Outcome,
                            testResult.RunByName,
                            testResult.DateCompleted,
                            testCaseUri,
                            testRunUri,
                            testResult.TestConfigurationName,
                            testResult.Duration));
                }
            }
        }
コード例 #18
0
 public void TestSetUp()
 {
     _uriFactory = new UriFactory(new Uri(Url));
 }
コード例 #19
0
 public void TestTearDown()
 {
     _uriFactory = null;
 }
コード例 #20
0
ファイル: ServerChannel.cs プロジェクト: mitchabaza/delen
 public ServerChannel(IUriFactory uriFactory)
 {
     _uriFactory = uriFactory;
 }
コード例 #21
0
 public TimelineClient(long matchId, HttpClient httpClient, IUriFactory uriFactory)
 {
     _matchId    = matchId;
     _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     _uriFactory = uriFactory ?? throw new ArgumentNullException(nameof(uriFactory));
 }
コード例 #22
0
ファイル: Endpoint.cs プロジェクト: anthrax3/LinqToRest
 public Endpoint(IRestQueryableFactory restQueryableFactory, IHttpService httpService, IUriFactory uriFactory)
 {
     _restQueryableFactory = restQueryableFactory;
     _httpService          = httpService;
     _uriFactory           = uriFactory;
 }
コード例 #23
0
ファイル: TableEntityFactory.cs プロジェクト: talexu/lvgaga
 public TableEntityFactory(IUriFactory uriFactory)
 {
     _uriFactory = uriFactory;
 }