public void GivenISubscribeToTheRowEvents()
 {
     _berlinClockApi.OnRow5HoursChanged   += (x) => _row5Hours = x;
     _berlinClockApi.OnRow1HourChanged    += (x) => _row1Hour = x;
     _berlinClockApi.OnRow5MinutesChanged += (x) => _row5Minutes = x;
     _berlinClockApi.OnRow1MinuteChanged  += (x) => _row1Minute = x;
 }
예제 #2
0
        /// <summary>
        /// Assert the expected data table with a result of 4 lights row.
        /// </summary>
        /// <param name="tableRow">Expected data row</param>
        /// <param name="row4LightsModel">Result of 4 lights row</param>
        public static void AssertLights(this TableRow tableRow, Row4LightsModel row4LightsModel)
        {
            bool expectedLight1 = bool.Parse(tableRow["Light1"]);
            bool expectedLight2 = bool.Parse(tableRow["Light2"]);
            bool expectedLight3 = bool.Parse(tableRow["Light3"]);
            bool expectedLight4 = bool.Parse(tableRow["Light4"]);

            Assert.IsNotNull(row4LightsModel, "The 4 lights model should be not null.");

            Assert.AreEqual(expectedLight1, row4LightsModel.Light1, string.Format(_errorMessage, 1, expectedLight1, row4LightsModel.Light1));
            Assert.AreEqual(expectedLight2, row4LightsModel.Light2, string.Format(_errorMessage, 2, expectedLight2, row4LightsModel.Light2));
            Assert.AreEqual(expectedLight3, row4LightsModel.Light3, string.Format(_errorMessage, 3, expectedLight3, row4LightsModel.Light3));
            Assert.AreEqual(expectedLight4, row4LightsModel.Light4, string.Format(_errorMessage, 4, expectedLight4, row4LightsModel.Light4));
        }
예제 #3
0
 public void GivenIImplementTheSecondRowOfTheBerlinClock()
 {
     _row1Hour = new Row1Hour();
     _row1Hour.OnRowChanged += (x) => _results = x;
 }
예제 #4
0
 /// <summary>
 /// Method triggered when the fourth row value changed.
 /// </summary>
 /// <param name="row1m">Updated parameters</param>
 private void Row1MinuteChange(Row4LightsModel row1m)
 => this.Set4Lights(this.R1m1, this.R1m2, this.R1m3, this.R1m4, row1m);
예제 #5
0
 /// <summary>
 /// Method triggered when the second row value changed.
 /// </summary>
 /// <param name="row1h">Updated parameters</param>
 private void Row1HourChange(Row4LightsModel row1h)
 => this.Set4Lights(this.R1h1, this.R1h2, this.R1h3, this.R1h4, row1h);
예제 #6
0
 /// <summary>
 /// Method triggered when the first row value changed.
 /// </summary>
 /// <param name="row5h">Updated parameters</param>
 private void Row5HoursChange(Row4LightsModel row5h)
 => this.Set4Lights(this.R5h1, this.R5h2, this.R5h3, this.R5h4, row5h);
예제 #7
0
 /// <summary>
 /// Set the UI element for a row of 4 lights with the values of the model "Row4LightsModel".
 /// </summary>
 private void Set4Lights(UIElement r1, UIElement r2, UIElement r3, UIElement r4, Row4LightsModel values)
 => _dispatcher.Invoke(() =>
 {
     r1.SetShapeOpacity(values.Light1);
     r2.SetShapeOpacity(values.Light2);
     r3.SetShapeOpacity(values.Light3);
     r4.SetShapeOpacity(values.Light4);
 });
예제 #8
0
 public void GivenIImplementTheFourthRowOfTheBerlinClock()
 {
     _row1Minute = new Row1Minute();
     _row1Minute.OnRowChanged += (x) => _results = x;
 }