コード例 #1
0
 public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_should_throw_ArgumentEmptyException(string testValue)
 {
     AssertThatThrows <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
コード例 #2
0
 public void When_calling_PassThroughNonNullNorEmpty_with_non_empty_values_should_return_input_as_output(string testValue)
 {
     AssertThatReturnsInputAsOutput(() => StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue), testValue);
 }
コード例 #3
0
 public void When_calling_PassThroughNonNullNorEmpty_with_whitespace_values_should_not_throw(string testValue)
 {
     AssertThatDoesNotThrow(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
コード例 #4
0
        public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
コード例 #5
0
 public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_with_custom_message_exception_message_should_match(string testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue, message: TestCustomExceptionMessage));
 }
コード例 #6
0
        public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_with_custom_argumentName_exception_argumentName_should_match(string testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentEmptyException>(() => _ = StringGuardiansExtension.PassThroughNonNullNorEmpty(testValue, testValueParamName), testValueParamName);
        }
コード例 #7
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);
        }