Esempio n. 1
0
        public void When_calling_ThrowIfNullOrEmpty_with_null_values_with_custom_argumentName_and_custom_message_exception_properties_should_match(IEnumerable testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameAndMessageShouldMatch <ArgumentNullException>(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue, testValueParamName, TestCustomExceptionMessage), testValueParamName, TestCustomExceptionMessage);
        }
Esempio n. 2
0
        public void When_calling_ThrowIfNullOrEmpty_with_null_values_with_custom_argumentName_exception_argumentName_should_match(IEnumerable testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentNullException>(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue, testValueParamName), testValueParamName);
        }
Esempio n. 3
0
 public void When_calling_ThrowIfNullOrEmpty_with_null_values_with_custom_message_exception_message_should_match(IEnumerable testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentNullException>(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue, message: TestCustomExceptionMessage));
 }
Esempio n. 4
0
 public void When_calling_PassThroughNonNullNorEmpty_with_non_empty_values_should_return_input_as_output(IEnumerable testValue)
 {
     AssertThatReturnsInputAsOutput(() => EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue), testValue);
 }
Esempio n. 5
0
        public void When_calling_ThrowIfNullOrEmpty_with_null_values_exception_argumentName_and_message_should_match_default(IEnumerable testValue)
        {
            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentNullMessageWithParamName, DefaultArgumentName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentNullException>(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue), defaultMessage);
        }
Esempio n. 6
0
 public void When_calling_PassThroughNonNullNorEmpty_with_null_values_should_throw_ArgumentNullException(IEnumerable testValue)
 {
     AssertThatThrows <ArgumentNullException>(() => _ = EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
Esempio n. 7
0
 public void When_calling_PassThroughNonNullNorEmpty_with_non_empty_values_should_not_throw(IEnumerable testValue)
 {
     AssertThatDoesNotThrow(() => _ = EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue));
 }
Esempio n. 8
0
 public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_with_custom_message_exception_message_should_match(IEnumerable testValue)
 {
     AssertThatExceptionMessageShouldMatchCustomMessage <ArgumentEmptyException>(() => _ = EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue, message: TestCustomExceptionMessage));
 }
Esempio n. 9
0
        public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_with_custom_argumentName_exception_argumentName_should_match(IEnumerable testValue)
        {
            const string testValueParamName = nameof(testValue);

            AssertThatExceptionParamNameShouldMatchCustomArgumentName <ArgumentEmptyException>(() => _ = EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue, testValueParamName), testValueParamName);
        }
Esempio n. 10
0
        public void When_calling_PassThroughNonNullNorEmpty_with_empty_values_exception_argumentName_and_message_should_match_default(IEnumerable testValue)
        {
            testValue.ThrowIfNull(nameof(testValue));

            var defaultMessage = string.Format(CultureInfo.InvariantCulture, FlabIt.Guardians.Properties.Resources.Exception_ArgumentOfTypeXEmptyMessageWithParamName, DefaultArgumentName, testValue.GetType().FullName);

            AssertThatExceptionParamNameAndMessageShouldMatchDefaultArgumentName <ArgumentEmptyException>(() => _ = EnumerableGuardiansExtension.PassThroughNonNullNorEmpty(testValue), defaultMessage);
        }
Esempio n. 11
0
 public void When_calling_ThrowIfNullOrEmpty_with_non_empty_values_should_not_throw(IEnumerable testValue)
 {
     AssertThatDoesNotThrow(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue));
 }
Esempio n. 12
0
 public void When_calling_ThrowIfNullOrEmpty_with_empty_values_should_throw_ArgumentEmptyException(IEnumerable testValue)
 {
     AssertThatThrows <ArgumentEmptyException>(() => EnumerableGuardiansExtension.ThrowIfNullOrEmpty(testValue));
 }