<commit_before>﻿namespace NGuard
{
    using System;

    public static class GuardExtensions
    {
        public static Guard<T> IsNotNull<T>(this Guard<T> guard) where T : class
        {
            if (guard.Value == null)
            {
                string paramName = guard.ArgumentName;
                string message = String.Format(
                    "{0} should not be null.",
                    paramName);

                throw new ArgumentNullException(paramName, message);
            }

            return guard;
        }

        public static Guard<string> IsNotEmpty(this Guard<string> guard)
        {
            if (guard.Value != null && guard.Value.Length == 0)
            {
                string paramName = guard.ArgumentName;
                string message = String.Format(
                    "{0} should not be an empty string.",
                    paramName);

                throw new ArgumentNullException(paramName, message);
            }

            return guard;
        }

        public static Guard<string> IsNotWhiteSpace(this Guard<string> guard)
        {
            if (guard.Value != null && guard.Value.Length > 0)
            {
                bool whitespace = true;
                for (int i = 0; i < guard.Value.Length; i++)
                {
                    if (!Char.IsWhiteSpace(guard.Value[i]))
                    {<commit_msg>Fixed exception type thrown by IsNotEmpty.<commit_after>﻿namespace NGuard
{
    using System;

    public static class GuardExtensions
    {
        public static Guard<T> IsNotNull<T>(this Guard<T> guard) where T : class
        {
            if (guard.Value == null)
            {
                string paramName = guard.ArgumentName;
                string message = String.Format(
                    "{0} should not be null.",
                    paramName);

                throw new ArgumentNullException(paramName, message);
            }

            return guard;
        }

        public static Guard<string> IsNotEmpty(this Guard<string> guard)
        {
            if (guard.Value != null && guard.Value.Length == 0)
            {
                string paramName = guard.ArgumentName;
                string message = String.Format(
                    "{0} should not be an empty string.",
                    paramName);

                throw new ArgumentException(message, paramName);
            }

            return guard;
        }

        public static Guard<string> IsNotWhiteSpace(this Guard<string> guard)
        {
            if (guard.Value != null && guard.Value.Length > 0)
            {
                bool whitespace = true;
                for (int i = 0; i < guard.Value.Length; i++)
                {
                    if (!Char.IsWhiteSpace(guard.Value[i]))
                    {
{'fraction_non_alphanumeric': 0.08891250442791357, 'fraction_numerical': 0.003542330853701736, 'mean_word_length': 1.3242798353909464, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3807871', 'n_tokens_mistral': 707, 'n_tokens_neox': 660, 'n_words': 189}