Exemplo n.º 1
0
 public static bool IsHappyOrExplicit(this DateTimeFieldTargets it)
 {
     if (it == DateTimeFieldTargets.HAPPY_PATH)
     {
         return(true);
     }
     if (it == DateTimeFieldTargets.EXPLICIT)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public static bool IsDigitRelevant(this DateTimeFieldTargets it)
 {
     switch (it)
     {
     case DateTimeFieldTargets.FIVE_DIGIT_YEAR:
     case DateTimeFieldTargets.FOUR_DIGIT_YEAR:
     case DateTimeFieldTargets.THREE_DIGIT_YEAR:
     case DateTimeFieldTargets.TWO_DIGIT_YEAR:
     case DateTimeFieldTargets.SINGLE_DIGIT_YEAR:
     case DateTimeFieldTargets.TWO_DIGIT_MONTH:
     case DateTimeFieldTargets.SINGLE_DIGIT_MONTH:
     case DateTimeFieldTargets.TWO_DIGIT_DAY:
     case DateTimeFieldTargets.SINGLE_DIGIT_DAY:
     case DateTimeFieldTargets.SINGLE_DIGIT_MONTH_AND_DAY:
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 public static bool IsLimitRelevant(this DateTimeFieldTargets it)
 {
     switch (it)
     {
     case DateTimeFieldTargets.WELL_BEYOND_LOWER_LIMIT:
     case DateTimeFieldTargets.WELL_BEYOND_UPPER_LIMIT:
     case DateTimeFieldTargets.WELL_WITHIN_LOWER_LIMIT:
     case DateTimeFieldTargets.WELL_WITHIN_UPPER_LIMIT:
     case DateTimeFieldTargets.SLIGHTLY_BEYOND_LOWER_LIMIT:
     case DateTimeFieldTargets.SLIGHTLY_BEYOND_UPPER_LIMIT:
     case DateTimeFieldTargets.SLIGHTLY_WITHIN_LOWER_LIMIT:
     case DateTimeFieldTargets.SLIGHTLY_WITHIN_UPPER_LIMIT:
     case DateTimeFieldTargets.RANDOM_WITHIN_LIMITS:
     case DateTimeFieldTargets.AT_LOWER_LIMIT:
     case DateTimeFieldTargets.AT_UPPER_LIMIT:
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
        public static string ToString(this DateTimeFieldTargets it)
        {
            switch (it)
            {
            case DateTimeFieldTargets.AT_LOWER_LIMIT:
                return("At Lower Limit");

            case DateTimeFieldTargets.AT_UPPER_LIMIT:
                return("At Upper Limit");

            case DateTimeFieldTargets.AT_PRESENT:
                return("Now");

            case DateTimeFieldTargets.EXPLICIT:
                return("Explicit Value");

            case DateTimeFieldTargets.HAPPY_PATH:
                return("Happy Path");

            case DateTimeFieldTargets.MAXIMUM_POSSIBLE_VALUE:
                return("Maximum Possible");

            case DateTimeFieldTargets.MINIMUM_POSSIBLE_VALUE:
                return("Minimum Possible");

            case DateTimeFieldTargets.NULL:
                return("Explicit Null");

            case DateTimeFieldTargets.RANDOM_WITHIN_LIMITS:
                return("Random Within Limits");

            case DateTimeFieldTargets.SLIGHTLY_ABOVE_MINIMUM:
                return("Slightly Above Minimum");

            case DateTimeFieldTargets.SLIGHTLY_IN_FUTURE:
                return("Slightly into the Future");

            case DateTimeFieldTargets.SLIGHTLY_BELOW_MAXIMUM:
                return("Slightly Below Maximum");

            case DateTimeFieldTargets.SLIGHTLY_IN_PAST:
                return("Slightly into the Past");

            case DateTimeFieldTargets.SLIGHTLY_BEYOND_LOWER_LIMIT:
                return("Slightly Beyond Lower Limit");

            case DateTimeFieldTargets.SLIGHTLY_BEYOND_UPPER_LIMIT:
                return("Slightly Beyond Upper Limit");

            case DateTimeFieldTargets.SLIGHTLY_WITHIN_LOWER_LIMIT:
                return("Slightly Within Lower Limit");

            case DateTimeFieldTargets.SLIGHTLY_WITHIN_UPPER_LIMIT:
                return("Slightly Within Upper Limit");

            case DateTimeFieldTargets.WELL_IN_FUTURE:
                return("Well into the Future");

            case DateTimeFieldTargets.WELL_IN_PAST:
                return("Well into the Past");

            case DateTimeFieldTargets.WELL_BEYOND_LOWER_LIMIT:
                return("Well Beyond Lower Limit");

            case DateTimeFieldTargets.WELL_BEYOND_UPPER_LIMIT:
                return("Well Beyond Upper Limit");

            case DateTimeFieldTargets.WELL_WITHIN_LOWER_LIMIT:
                return("Well Within Lower Limit");

            case DateTimeFieldTargets.WELL_WITHIN_UPPER_LIMIT:
                return("Well Within Upper Limit");

            case DateTimeFieldTargets.FIVE_DIGIT_YEAR:
                return("Five Digit Year");

            case DateTimeFieldTargets.FOUR_DIGIT_YEAR:
                return("Four Digit Year");

            case DateTimeFieldTargets.THREE_DIGIT_YEAR:
                return("Three Digit Year");

            case DateTimeFieldTargets.TWO_DIGIT_YEAR:
                return("Two Digit Year");

            case DateTimeFieldTargets.SINGLE_DIGIT_YEAR:
                return("Single Digit Year");

            case DateTimeFieldTargets.TWO_DIGIT_MONTH:
                return("Two Digit Month");

            case DateTimeFieldTargets.SINGLE_DIGIT_MONTH:
                return("Single Digit Month");

            case DateTimeFieldTargets.TWO_DIGIT_DAY:
                return("Two Digit Day");

            case DateTimeFieldTargets.SINGLE_DIGIT_DAY:
                return("Single Digit Day");

            case DateTimeFieldTargets.SINGLE_DIGIT_MONTH_AND_DAY:
                return("Single Digit Month and Day");
            }

            return("Left Default");
        }
Exemplo n.º 5
0
 public override void SetToExplicitValue(DateTime value)
 {
     BasisValue = value;
     Target     = DateTimeFieldTargets.EXPLICIT;
 }