Exemple #1
0
        public void GivenASearchValue_WhenCompareWithDateSearchValue_ThenCorrectResultIsReturned(string original, string given, int expectedMinResult, int expectedMaxResult)
        {
            DateTimeSearchValue originalValue = DateTimeSearchValue.Parse(original);
            DateTimeSearchValue givenValue    = DateTimeSearchValue.Parse(given);

            int minResult = originalValue.CompareTo(givenValue, ComparisonRange.Min);
            int maxResult = originalValue.CompareTo(givenValue, ComparisonRange.Max);

            Assert.Equal(expectedMinResult, minResult);
            Assert.Equal(expectedMaxResult, maxResult);
        }
Exemple #2
0
        public void GivenAStringSearchValue_WhenCompareWithNull_ThenArgumentExceptionIsThrown()
        {
            DateTimeSearchValue value = DateTimeSearchValue.Parse("2020");

            Assert.Throws <ArgumentException>(() => value.CompareTo(null, ComparisonRange.Max));
        }