Пример #1
0
        public void CreateFilingTarget_ThrowsIfUriIsNull
            ()
        {
            Action action = () => FilingClientFactory.Create(null);

            action.Should().Throw <ArgumentNullException>();
        }
Пример #2
0
        public void CreateFilingTarget_ThrowsIfUriIncludesAdditionalPathSegments()
        {
            Uri hostUri = new Uri("https://github.com/myOrg/myProject/issues");

            Action action = () => FilingClientFactory.Create(hostUri);

            action.Should().Throw <ArgumentException>().WithMessage($"*{hostUri}*");
        }
Пример #3
0
        public void CreateFilingTarget_ThrowsIfUriPatternIsNotRecognized()
        {
            Uri hostUri = new Uri("https://www.example.com/myOrg/myProject");

            Action action = () => FilingClientFactory.Create(hostUri);

            action.Should().Throw <ArgumentException>().WithMessage($"*{hostUri}*");
        }
Пример #4
0
        public void CreateFilingTarget_CreatesLegacyAzureDevOpsFilingTarget()
        {
            Uri hostUri = new Uri("https://myorg.visualstudio.com/myProject");

            FilingClient filingTarget = FilingClientFactory.Create(hostUri);

            filingTarget.ProjectOrRepository.Should().NotBeNull();
            string.IsNullOrEmpty(filingTarget.ProjectOrRepository).Should().BeFalse();
            string.IsNullOrEmpty(filingTarget.AccountOrOrganization).Should().BeFalse();
        }
Пример #5
0
        public void CreateFilingTarget_CreatesAzureDevOpsFilingTarget()
        {
            Uri hostUri = new Uri("https://dev.azure.com/myOrg/myProject");

            FilingClient filingTarget = FilingClientFactory.Create(hostUri);

            filingTarget.Should().BeOfType <AzureDevOpsFilingClient>();
            string.IsNullOrEmpty(filingTarget.ProjectOrRepository).Should().BeFalse();
            string.IsNullOrEmpty(filingTarget.AccountOrOrganization).Should().BeFalse();
        }
        public void CreateFilingTarget_CreatesGitHubFilingTarget()
        {
            Uri projectUri = new Uri("https://github.com/myOrg/myProject");

            var filingTarget = FilingClientFactory.Create(projectUri);

            filingTarget.Should().BeOfType <GitHubFilingClient>();
            string.IsNullOrEmpty(filingTarget.ProjectOrRepository).Should().BeFalse();
            string.IsNullOrEmpty(filingTarget.AccountOrOrganization).Should().BeFalse();
        }