Exemple #1
0
        public void PassesFilter_WithValidMethodArgumentAndParameter_ReturnsBool(DateTime argument, DateTime toTest,
                                                                                 DateFilter.DateFilterMethods method, bool expected)
        {
            var filter = new DateFilter(method, argument);
            var result = filter.PassesFilter(toTest);

            Assert.Equal(expected, result);
        }
Exemple #2
0
 public EpisodePublishDateFilterModification(DateTime date, DateFilter.DateFilterMethods method)
     : base(
         "//item/pubDate",
         new XElementFilterModification(new DateFilter(method, date))
         )
 {
     Date   = date;
     Method = method;
 }
Exemple #3
0
        public override string DateFilterMethodToDisplayString(DateFilter.DateFilterMethods method)
        {
            switch (method)
            {
            case DateFilter.DateFilterMethods.Greater:
                return("after");

            case DateFilter.DateFilterMethods.GreaterEquals:
                return("at or after");

            case DateFilter.DateFilterMethods.Smaller:
                return("before");

            case DateFilter.DateFilterMethods.SmallerEquals:
                return("at or before");

            default:
                throw new ArgumentException($"DateFilterMethod {method} is unknown.");
            }
        }
 public abstract string DateFilterMethodToDisplayString(DateFilter.DateFilterMethods method);