public void TestThatNotNullThrowsArgumentNullExceptionWhenArgumentNameIsNullEmptyOrWhiteSpace(string argumentName)
        {
            IArgumentNullGuard sut = CreateSut();

            object value = _fixture.Create <object>();
            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNull(value, argumentName));

            TestHelper.AssertArgumentNullExceptionIsValid(result, "argumentName");
        }
        public void TestThatNotNullOrWhiteSpaceThrowsArgumentNullExceptionWhenStringValueIsNullOrWhiteSpace(string value)
        {
            IArgumentNullGuard sut = CreateSut();

            string argumentName          = _fixture.Create <string>();
            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNullOrWhiteSpace(value, argumentName));

            TestHelper.AssertArgumentNullExceptionIsValid(result, argumentName);
        }
        public void TestThatNotNullReturnsArgumentNullGuardWhenStringValueIsEmptyOrWhitespace(string value)
        {
            IArgumentNullGuard sut = CreateSut();

            string             argumentName = _fixture.Create <string>();
            IArgumentNullGuard result       = sut.NotNull(value, argumentName);

            Assert.IsNotNull(result);
            Assert.AreSame(sut, result);
        }
        public void TestThatNotNullThrowsArgumentNullExceptionWhenObjectValueIsNull()
        {
            IArgumentNullGuard sut = CreateSut();

            const object          value        = null;
            string                argumentName = _fixture.Create <string>();
            ArgumentNullException result       = Assert.Throws <ArgumentNullException>(() => sut.NotNull(value, argumentName));

            TestHelper.AssertArgumentNullExceptionIsValid(result, argumentName);
        }
        public void TestThatNotNullReturnsArgumentNullGuardWhenObjectValueIsNotNull()
        {
            IArgumentNullGuard sut = CreateSut();

            object             value        = _fixture.Create <object>();
            string             argumentName = _fixture.Create <string>();
            IArgumentNullGuard result       = sut.NotNull(value, argumentName);

            Assert.IsNotNull(result);
            Assert.AreSame(sut, result);
        }
        /// <summary>
        /// Validates whether the <paramref name="value"/> is null or empty and throws an <see cref="ArgumentNullException"/> when so.
        /// </summary>
        /// <param name="value">The value to validate.</param>
        /// <param name="argumentName">The name of the argument.</param>
        /// <returns>Instance of Argument Null Guard.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <see cref="value"/> is null or empty or when the <see cref="argumentName"/> is null, empty or white space.</exception>
        public static IArgumentNullGuard NotNullOrEmpty(string value, string argumentName)
        {
            IArgumentNullGuard argumentNullGuard = Create();

            return(argumentNullGuard.NotNullOrEmpty(value, argumentName));
        }
        /// <summary>
        /// Validates whether the <paramref name="value"/> is null and throws an <see cref="ArgumentNullException"/> when so.
        /// </summary>
        /// <param name="value">The value to validate.</param>
        /// <param name="argumentName">The name of the argument.</param>
        /// <returns>Instance of Argument Null Guard.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <see cref="value"/> is null or when the <see cref="argumentName"/> is null, empty or white space.</exception>
        public static IArgumentNullGuard NotNull(object value, string argumentName)
        {
            IArgumentNullGuard argumentNullGuard = Create();

            return(argumentNullGuard.NotNull(value, argumentName));
        }