public void When_calling_PassThroughNonNullNorWhitespace_with_null_values_exception_argumentName_and_message_should_match_default(string testValue)
        {
            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentNullMessageWithParamName, DefaultArgumentName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentNullException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorWhitespace(testValue), defaultMessage);
        }
Esempio n. 2
0
 public void When_calling_ThrowIfLargerThan_with_values_larger_than_length_with_custom_message_exception_message_should_match(string testValue, int testLength)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentLengthLargerThanException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength, message: TestCustomExceptionMessage));
 }
Esempio n. 3
0
 public void When_calling_ThrowIfLargerThan_with_non_null_values_should_not_throw(string testValue)
 {
     AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testValue.Length + 1));
 }
Esempio n. 4
0
 public void When_calling_PassThroughNonLargerThan_with_values_shorter_than_or_equal_to_length_should_return_input_as_output(string testValue, int testLength)
 {
     AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength), testValue);
 }
Esempio n. 5
0
        public void When_calling_ThrowIfLargerThan_with_null_values_with_custom_message_exception_message_should_match(string testValue)
        {
            const int testLength = 0;

            AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength, message: TestCustomExceptionMessage));
        }
Esempio n. 6
0
        public void When_calling_ThrowIfLargerThan_with_null_values_exception_argumentName_and_message_should_match_default(string testValue)
        {
            const int testLength = 0;

            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentNullMessageWithParamName, DefaultArgumentName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength), defaultMessage);
        }
Esempio n. 7
0
 public void When_calling_PassThroughNonLargerThan_with_non_null_values_should_not_throw(string testValue, int testLength)
 {
     AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength), testValue);
 }
Esempio n. 8
0
        public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_exception_argumentName_and_message_should_match_default(string testValue)
        {
            testValue.ThrowIfNull(nameof(testValue));

            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentOfTypeXEmptyMessageWithParamName, DefaultArgumentName, typeof(string).FullName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue), defaultMessage);
        }
Esempio n. 9
0
 public void When_calling_PassThroughNonNullNorEmpty_with_whitespace_values_should_not_throw(string testValue)
 {
     AssertThatDoesNotThrow(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
Esempio n. 10
0
        public void When_calling_PassThroughNonNullNorEmpty_with_null_values_with_custom_argumentName_exception_argumentName_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentNullException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue, testValueParamName), testValueParamName);
        }
Esempio n. 11
0
 public void When_calling_PassThroughNonNullNorEmpty_with_null_values_with_custom_message_exception_message_should_match(string testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue, message: TestCustomExceptionMessage));
 }
        public void When_calling_ThrowIfNullOrWhitespace_with_whitespace_values_exception_argumentName_and_message_should_match_default(string testValue)
        {
            testValue.ThrowIfNull(nameof(testValue));

            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentOfTypeXOnlyWhitespaceMessageWithParamName, DefaultArgumentName, typeof(string).FullName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentWhitespaceException>(() => StringGuardiansExtension.ThrowIfNullOrWhitespace(testValue), defaultMessage);
        }
 public void When_calling_PassThroughNonNullNorWhitespace_with_whitespace_values_should_throw_ArgumentWhitespaceException(string testValue)
 {
     AssertThatThrows <ArgumentWhitespaceException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorWhitespace(testValue));
 }
        public void When_calling_PassThroughNonNullNorWhitespace_with_whitespace_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentWhitespaceException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorWhitespace(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Esempio n. 15
0
 public void When_calling_ThrowIfLargerThan_with_values_not_larger_than_given_length_should_not_throw(string testValue, int testLength)
 {
     AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength));
 }
Esempio n. 16
0
 public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_should_throw_ArgumentEmptyException(string testValue)
 {
     AssertThatThrows <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
Esempio n. 17
0
        public void When_calling_PassThroughNonLargerThan_with_null_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);
            const int    testLength         = 0;

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentNullException>(() => _ = StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Esempio n. 18
0
 public void When_calling_PassThroughNonNullNorEmpty_with_non_empty_values_should_return_input_as_output(string testValue)
 {
     AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue), testValue);
 }
Esempio n. 19
0
        public void When_calling_PassThroughNonLargerThan_with_values_larger_than_length_with_custom_argumentName_exception_argumentName_should_match(string testValue, int testLength)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentLengthLargerThanException>(() => _ = StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength, testValueParamName), testValueParamName);
        }
Esempio n. 20
0
        public void When_calling_ThrowIfNullOrEmpty_with_empty_values_with_custom_argumentName_exception_argumentName_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentEmptyException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue, testValueParamName), testValueParamName);
        }
Esempio n. 21
0
 public void When_calling_PassThroughNonLargerThan_with_values_larger_than_length_should_throw_ArgumentLengthLargerThanException(string testValue, int testLength)
 {
     AssertThatThrows <ArgumentLengthLargerThanException>(() => _ = StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength));
 }
Esempio n. 22
0
 public void When_calling_ThrowIfNullOrEmpty_with_empty_values_with_custom_message_exception_message_should_match(string testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentEmptyException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue, message: TestCustomExceptionMessage));
 }
Esempio n. 23
0
        public void When_calling_ThrowIfLargerThan_with_null_values_with_custom_argumentName_exception_argumentName_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);
            const int    testLength         = 0;

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength, testValueParamName), testValueParamName);
        }
Esempio n. 24
0
        public void When_calling_ThrowIfNullOrEmpty_with_empty_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentEmptyException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Esempio n. 25
0
        public void When_calling_ThrowIfLargerThan_with_values_larger_than_length_exception_argumentName_and_message_should_match_default(string testValue, int testLength)
        {
            testValue.ThrowIfNull(nameof(testValue));

            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentOfTypeXLargerThanMessageWithParamName, DefaultArgumentName, typeof(string).FullName, testLength, testValue.Length);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentLengthLargerThanException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength), defaultMessage);
        }
Esempio n. 26
0
 public void When_calling_ThrowIfNullOrEmpty_with_null_values_should_throw_ArgumentNullException(string testValue)
 {
     AssertThatThrows <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue));
 }
Esempio n. 27
0
        public void When_calling_ThrowIfLargerThan_with_values_larger_than_length_with_custom_argumentName_and_custom_message_exception_properties_should_match(string testValue, int testLength)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentLengthLargerThanException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Esempio n. 28
0
 public void When_calling_ThrowIfNullOrEmpty_with_whitespace_values_should_not_throw(string testValue)
 {
     AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue));
 }
Esempio n. 29
0
        public void When_calling_ThrowIfLargerThan_with_null_values_should_throw_ArgumentNullException(string testValue)
        {
            const int testLength = 0;

            AssertThatThrows <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength));
        }
 public void When_calling_ThrowIfNullOrWhitespace_with_non_whitespace_values_should_return_input_as_output(string testValue)
 {
     AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.ThrowIfNullOrWhitespace(testValue), testValue);
 }