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); }
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); }
public ConsoleColorFactory(CalendarCoreLogicConfiguration configuration) { this.configuration = configuration; }