Пример #1
0
 public void When_calling_PassThroughNonNull_with_non_null_values_should_not_throw(object testValue)
 {
     AssertThatDoesNotThrow(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue));
 }
Пример #2
0
 public void When_calling_PassThroughNonNull_with_non_null_values_should_return_input_as_output(object testValue)
 {
     AssertThatReturnsInputAsOutput(() => GenericGuardiansExtension.PassThroughNonNull(testValue), testValue);
 }
Пример #3
0
 public void When_calling_PassThroughNonNull_with_null_values_should_throw_ArgumentNullException(object testValue)
 {
     AssertThatThrows <ArgumentNullException>(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue));
 }
Пример #4
0
        public void When_calling_PassThroughNonNull_with_null_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(object testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentNullException>(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Пример #5
0
 public void When_calling_PassThroughNonNull_with_null_values_with_custom_message_exception_message_should_match(object testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue, message: TestCustomExceptionMessage));
 }
Пример #6
0
        public void When_calling_PassThroughNonNull_with_null_values_with_custom_argumentName_exception_argumentName_should_match(object testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentNullException>(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue, testValueParamName), testValueParamName);
        }
Пример #7
0
        public void When_calling_PassThroughNonNull_with_null_values_exception_argumentName_and_message_should_match_default(object testValue)
        {
            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentNullMessageWithParamName, DefaultArgumentName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentNullException>(() => _ = GenericGuardiansExtension.PassThroughNonNull(testValue), defaultMessage);
        }