public void There_are_default_lane_type_colour_ranges_if_they_are_not_specified_in_the_configuration() { // Given var configuration = CreateDefaultConfiguration(100, 10); var target = new LeanKitCumlativeFlowPresenter(configuration, mockDayUpdateMonitor.Object); CumaltiveFlowDataUpdateEventArgs eventArguments = null; SetupUpdateHistory(10); AutoResetEvent wait = new AutoResetEvent(false); target.CumaltiveFlowDataUpdate += (o, e) => { eventArguments = e; wait.Set(); }; // When mockDayUpdateMonitor.Raise(m => m.DayChanged += null, EventArgs.Empty); Assert.IsTrue(wait.WaitOne(5000)); // Then Assert.AreEqual(Color.FromArgb(200, 0x00, 0x00), eventArguments.ReadyStartColour); Assert.AreEqual(Color.FromArgb(150, 0x00, 0x00), eventArguments.ReadyEndColour); Assert.AreEqual(Color.FromArgb(0x00, 0x00, 200), eventArguments.InProcessStartColour); Assert.AreEqual(Color.FromArgb(0x00, 0x00, 150), eventArguments.InProcessEndColour); Assert.AreEqual(Color.FromArgb(0x00, 200, 0x00), eventArguments.CompleteStartColour); Assert.AreEqual(Color.FromArgb(0x00, 150, 0x00), eventArguments.CompleteEndColour); }
public void Configuring_the_lane_type_colour_ranges() { // Given var configuration = CreateDefaultConfiguration(100, 10); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "ReadyStartColour", Value = "FF0000" }); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "ReadyEndColour", Value = "0F0000" }); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "InProcessStartColour", Value = "00FF00" }); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "InProcessEndColour", Value = "000F00" }); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "CompleteStartColour", Value = "0000FF" }); configuration.Add(new InformationRadiatorItemConfigurationField() { ID = "CompleteEndColour", Value = "00000F" }); var target = new LeanKitCumlativeFlowPresenter(configuration, mockDayUpdateMonitor.Object); CumaltiveFlowDataUpdateEventArgs eventArguments = null; SetupUpdateHistory(10); AutoResetEvent wait = new AutoResetEvent(false); target.CumaltiveFlowDataUpdate += (o, e) => { eventArguments = e; wait.Set(); }; // When mockDayUpdateMonitor.Raise(m => m.DayChanged += null, EventArgs.Empty); Assert.IsTrue(wait.WaitOne(5000)); // Then Assert.AreEqual(Color.FromArgb(0xFF, 0x00, 0x00), eventArguments.ReadyStartColour); Assert.AreEqual(Color.FromArgb(0x0F, 0x00, 0x00), eventArguments.ReadyEndColour); Assert.AreEqual(Color.FromArgb(0x00, 0xFF, 0x00), eventArguments.InProcessStartColour); Assert.AreEqual(Color.FromArgb(0x00, 0x0F, 0x00), eventArguments.InProcessEndColour); Assert.AreEqual(Color.FromArgb(0x00, 0x00, 0xFF), eventArguments.CompleteStartColour); Assert.AreEqual(Color.FromArgb(0x00, 0x00, 0x0F), eventArguments.CompleteEndColour); }