Exemple #1
0
        public void PostConfigure_ThrowsArgumentException_OnNullBaseUrlInConfiguration(
            string baseUrl,
            string expectedInvalidValue)
        {
            // Arrange

            var name = nameGenerator.Next();

            var configuration = new GitLabConfiguration {
                BaseUrl =
                    baseUrl == null
                        ? null
                        : new Uri(baseUrl, UriKind.RelativeOrAbsolute)
            };

            var verifier = new GitLabConfigurationVerifier();

            // Act

            var exception = Record.Exception(
                () => verifier.PostConfigure(name, configuration)
                );

            // Assert

            Assert.IsType <ArgumentException>(exception);
            Assert.Contains(expectedInvalidValue, exception.Message);
        }
Exemple #2
0
        public void PostConfigure_ThrowsArgumentNullException_OnNullConfiguration()
        {
            // Arrange

            var name = nameGenerator.Next();

            var verifier = new GitLabConfigurationVerifier();

            // Act

            var exception = Record.Exception(
                () => verifier.PostConfigure(name, null)
                );

            // Assert

            Assert.IsType <ArgumentNullException>(exception);
        }
Exemple #3
0
        public void PostConfigure_DefaultValuesAreValid()
        {
            // Arrange

            var name          = nameGenerator.Next();
            var configuration = new GitLabConfiguration();

            var verifier = new GitLabConfigurationVerifier();

            // Act

            var exception = Record.Exception(
                () => verifier.PostConfigure(name, configuration)
                );

            // Assert

            Assert.Null(exception);
        }