コード例 #1
0
        public void TestInvalidInput()
        {
            var testedRenderer  = new StringBerlinClockRenderer();
            var berlinClockData = new BerlinClockData()
            {
                FiveHoursLightsCount   = 10, //invalid
                FiveMinutesLightsCount = 0,
                IsOneSecondLightActive = true,
                OneHourLightsCount     = 0,
                OneMinuteLightsCount   = 0
            };

            testedRenderer.RenderBerlinClock(berlinClockData);
        }
コード例 #2
0
        public void TestZeroTimeRendition()
        {
            var lightRepresentation = CreateLightRepresentation();
            var testedRenderer      = new StringBerlinClockRenderer(lightRepresentation);
            var berlinClockData     = new BerlinClockData()
            {
                FiveHoursLightsCount   = 0,
                FiveMinutesLightsCount = 0,
                IsOneSecondLightActive = true,
                OneHourLightsCount     = 0,
                OneMinuteLightsCount   = 0
            };

            var result = testedRenderer.RenderBerlinClock(berlinClockData);

            Assert.AreEqual(LengthOfRendition, result.Length);
            Assert.AreEqual("y\r\nXXXX\r\nXXXX\r\nXXXXXXXXXXX\r\nXXXX", result);
        }