Exemple #1
0
        public void GetById_ValidId_ReturnsColorFromConfiguration()
        {
            var configuration = new CalendarCoreLogicConfiguration {
                CalendarColors = new List <CalendarColor> {
                    new CalendarColor {
                        Id           = ColorId,
                        ConsoleColor = Color.ToString()
                    }
                }
            };

            this.SetDependency(configuration);

            var actual = this.Target.GetById(CalendarKey, ColorId);

            Assert.AreEqual(Color, actual);
        }
Exemple #2
0
        public void GetById_InvalidColorId_ReturnsDefaultColor()
        {
            var configuration = new CalendarCoreLogicConfiguration {
                CalendarColors = new List <CalendarColor> {
                    new CalendarColor {
                        Id           = ColorId + 1,
                        ConsoleColor = Color.ToString()
                    }
                }
            };

            this.SetDependency(configuration);

            var actual = this.Target.GetById(CalendarKey, ColorId);

            Assert.AreEqual(ConsoleColor.White, actual);
        }
Exemple #3
0
 public ConsoleColorFactory(CalendarCoreLogicConfiguration configuration)
 {
     this.configuration = configuration;
 }