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); }
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)); }
public void When_calling_ThrowIfLargerThan_with_non_null_values_should_not_throw(string testValue) { AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testValue.Length + 1)); }
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); }
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)); }
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); }
public void When_calling_PassThroughNonLargerThan_with_non_null_values_should_not_throw(string testValue, int testLength) { AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength), testValue); }
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); }
public void When_calling_PassThroughNonNullNorEmpty_with_whitespace_values_should_not_throw(string testValue) { AssertThatDoesNotThrow(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue)); }
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); }
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); }
public void When_calling_ThrowIfLargerThan_with_values_not_larger_than_given_length_should_not_throw(string testValue, int testLength) { AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfLargerThan(testValue, testLength)); }
public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_should_throw_ArgumentEmptyException(string testValue) { AssertThatThrows <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue)); }
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); }
public void When_calling_PassThroughNonNullNorEmpty_with_non_empty_values_should_return_input_as_output(string testValue) { AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue), testValue); }
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); }
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); }
public void When_calling_PassThroughNonLargerThan_with_values_larger_than_length_should_throw_ArgumentLengthLargerThanException(string testValue, int testLength) { AssertThatThrows <ArgumentLengthLargerThanException>(() => _ = StringGuardiansExtension.PassThroughNonLargerThan(testValue, testLength)); }
public void When_calling_ThrowIfNullOrEmpty_with_empty_values_with_custom_message_exception_message_should_match(string testValue) { AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentEmptyException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue, message: TestCustomExceptionMessage)); }
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); }
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); }
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); }
public void When_calling_ThrowIfNullOrEmpty_with_null_values_should_throw_ArgumentNullException(string testValue) { AssertThatThrows <ArgumentNullException>(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue)); }
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); }
public void When_calling_ThrowIfNullOrEmpty_with_whitespace_values_should_not_throw(string testValue) { AssertThatDoesNotThrow(() => StringGuardiansExtension.ThrowIfNullOrEmpty(testValue)); }
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); }