Esempio n. 1
0
        static void Main(string[] args)
        {
            var rv = new RevanClock();

            // Toggle comment to change the parser to one that recognizes C#'s DateTime Class
            // rv.Parser = new CSParser();

            // Toggle comment to change the 5 hour/minute chunks to 12 hour/minute chunks
            // rv.Encoder = new StandardEncoder(12);

            // Bulb is used to change the character that represents a bulb.
            // rv.Bulb = new ROBulb();

            // This is how we would change the color of the bulb located 3rd, 6th, 9th.
            // rv.Accent = new QuarterAccent(new YOBulb());

            // Formatter is where we would be able to convert the string output to an html output
            // rv.Formatter [not implemented]

            Console.WriteLine("Please enter the time in a 24-hour format [hh:mm:ss]: ");
            string timeString = Console.ReadLine();

            Console.WriteLine(rv.parse(timeString));


            Console.WriteLine("\n\nPress enter to quit.");
            Console.ReadLine();
        }
Esempio n. 2
0
        public void TestSampleTime()
        {
            var expectedOutput = "Y RRRO ROOO YYRYYRYOOOO YYOO";
            var input          = "16:37:16";

            // create a clock
            var revan = new Revan.RevanClock();

            Assert.AreEqual(expectedOutput, revan.parse(input), "The time did not parse corectly");
        }
Esempio n. 3
0
        public void TestBulbSwap()
        {
            var expectedOutput = "R YYYO YOOO RRYRRYROOOO RROO";
            var input          = "16:37:16";

            // create a clock
            var revan = new Revan.RevanClock()
            {
                Bulb   = new Revan.ROBulb(),
                Accent = new Revan.QuarterAccent(new Revan.YOBulb())
            };

            Assert.AreEqual(expectedOutput, revan.parse(input), "The time did not parse corectly");
        }