Exemplo n.º 1
0
        public void DateSearchStrategy_OnlyFrom_Test()
        {
            var fromToParam = new FromToParam(DateTime.Now.AddYears(-1), DateTime.MaxValue);
            // Arrange
            var dataSearchStrategy = new DateSearchStrategy(fromToParam);

            // Act
            var result = 0;

            foreach (var @event in _events)
            {
                result += dataSearchStrategy.Compare(@event) ? 1 : 0;
            }


            // Assert
            Assert.Equal(3, result);
        }
Exemplo n.º 2
0
        public void DateSearchStrategy_Wrong_Test()
        {
            var fromToParam = new FromToParam(DateTime.MinValue, DateTime.MinValue);
            // Arrange
            var dataSearchStrategy = new DateSearchStrategy(fromToParam);

            // Act
            var result = 0;

            foreach (var @event in _events)
            {
                result += dataSearchStrategy.Compare(@event) ? 1 : 0;
            }


            // Assert
            Assert.Equal(0, result);
        }