Пример #1
0
        public void DateRange_InvalidDate_ReturnsException()
        {
            // Arrange
            var toggle = new AfterDateRangeToggleInvalidAfterDate(new DatesProvider());

            // ACT

            // Assert
            Assert.Throws <ArgumentException>(() =>
            {
                var result = toggle.Enabled;
            });
        }
Пример #2
0
            public DatesProvider()
            {
                var invalidNumberOfDates = new AfterDateRangeToggleInvalidAfterDate();

                var afterNowToggle  = new AfterDateRangeToggleNow();
                var beforeNowToggle = new AfterDateRangeToggleBeforeNow();


                var beforeNow = DateTime.Now.AddMinutes(-10).ToLongTimeString();
                var afterNow  = DateTime.Now.AddMinutes(10).ToLongTimeString();

                _kvp = new Dictionary <string, string>
                {
                    { invalidNumberOfDates.Key, "InvalidDate" },
                    { afterNowToggle.Key, afterNow },
                    { beforeNowToggle.Key, beforeNow },
                };
            }