コード例 #1
0
 public void When_calling_ThrowIfNull_with_non_null_values_should_not_throw(object testValue)
 {
     AssertThatDoesNotThrow(() => GenericGuardiansExtension.ThrowIfNull(testValue));
 }
コード例 #2
0
 public void When_calling_ThrowIfNull_with_non_null_values_should_return_input_as_output(object testValue)
 {
     AssertThatReturnsInputAsOutput(() => GenericGuardiansExtension.ThrowIfNull(testValue), testValue);
 }
コード例 #3
0
 public void When_calling_ThrowIfNull_with_null_values_should_throw_ArgumentNullException(object testValue)
 {
     AssertThatThrows <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue));
 }
コード例 #4
0
        public void When_calling_ThrowIfNull_with_null_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(object testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
コード例 #5
0
 public void When_calling_ThrowIfNull_with_null_values_with_custom_message_exception_message_should_match(object testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue, message: TestCustomExceptionMessage));
 }
コード例 #6
0
        public void When_calling_ThrowIfNull_with_null_values_with_custom_argumentName_exception_argumentName_should_match(object testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue, testValueParamName), testValueParamName);
        }
コード例 #7
0
        public void When_calling_ThrowIfNull_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.ThrowIfNull(testValue), defaultMessage);
        }