Example #1
0
        public static void Specification_DateRange(string expected, string from, string to)
        {
            // Arrange
            var spec = new HistoryLogSpecification()
            {
                DateRange = new Range <DateTime>(DateTime.Parse(from, CultureInfo.InvariantCulture), DateTime.Parse(to, CultureInfo.InvariantCulture))
            };

            // Act
            var result = HistoryLogKeyHelper.Specification(spec);

            // Assert
            Assert.Equal(expected, result);
        }
Example #2
0
        public static void Specification_Events(string expected, string events)
        {
            // Arrange
            var spec = new HistoryLogSpecification()
            {
                DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14)),
                Events    = events.Split(';').Translate(s => Int16.Parse(s, CultureInfo.InvariantCulture)).ToArray()
            };

            // Act
            var result = HistoryLogKeyHelper.Specification(spec);

            // Assert
            Assert.Equal(expected, result);
        }
Example #3
0
        public static void Specification_EventId(string expected, int eventid)
        {
            // Arrange
            var spec = new HistoryLogSpecification()
            {
                DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14)),
                EventId   = (short)eventid
            };

            // Act
            var result = HistoryLogKeyHelper.Specification(spec);

            // Assert
            Assert.Equal(expected, result);
        }
Example #4
0
        public static void Specification_Username(string expected, string username)
        {
            // Arrange
            var spec = new HistoryLogSpecification()
            {
                Username  = username,
                DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14))
            };

            // Act
            var result = HistoryLogKeyHelper.Specification(spec);

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