public void When_calling_ThrowIfNull_with_non_null_values_should_not_throw(object testValue) { AssertThatDoesNotThrow(() => GenericGuardiansExtension.ThrowIfNull(testValue)); }
public void When_calling_ThrowIfNull_with_non_null_values_should_return_input_as_output(object testValue) { AssertThatReturnsInputAsOutput(() => GenericGuardiansExtension.ThrowIfNull(testValue), testValue); }
public void When_calling_ThrowIfNull_with_null_values_should_throw_ArgumentNullException(object testValue) { AssertThatThrows <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue)); }
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); }
public void When_calling_ThrowIfNull_with_null_values_with_custom_message_exception_message_should_match(object testValue) { AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => GenericGuardiansExtension.ThrowIfNull(testValue, message: TestCustomExceptionMessage)); }
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); }
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); }