Beispiel #1
0
        public void SetDesiredPosition_NonExistentValueReturnsFalse()
        {
            var pm = new ProgramMethods();
            var kb = new Keyboard();

            var TenCoordinates = pm.SetDesiredPosition("10", kb);

            Assert.AreEqual(TenCoordinates.letterExists, false, "letter 10 should not be found on keyboard");
        }
Beispiel #2
0
        public void SetDesiredPosition_Initial()
        {
            var pm = new ProgramMethods();
            var kb = new Keyboard();

            var ACoordinates = pm.SetDesiredPosition("A", kb);

            Assert.AreEqual(ACoordinates.x, 1, "x coordinate of 'A' should be 1");
            Assert.AreEqual(ACoordinates.y, 0, "y coordinate of 'A' should be 0");
        }
        public void TrackPathAndSelect_Initial()
        {
            var pm = new ProgramMethods();
            var kb = new Keyboard();

            kb.DesiredPosX = 6;
            kb.DesiredPosY = 5;

            bool didExecutePath = pm.TrackPathAndSelect(kb);

            Assert.AreEqual(true, didExecutePath, "Path was not executed properly");
        }
        public void Output_Initial()
        {
            bool   fileExists = true;
            var    pm         = new ProgramMethods();
            string path       = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "OSKtest");

            if (!File.Exists(path))
            {
                fileExists = false;
                using (StreamWriter sw = File.CreateText(path))
                {
                    sw.WriteLine("Hello");
                }
            }
            var list = pm.Output(path);

            Assert.AreEqual(list[0], "D,R,#,U,R,R,R,#,D,R,#,#,D,L,L,L,#");
            if (!fileExists)
            {
                File.Delete(path);
            }
        }
Beispiel #5
0
 public void TestInitialize()
 {
     kb = new Keyboard();
     pm = new ProgramMethods();
 }