Esempio n. 1
0
        static void Main(string[] args)
        {
            Lua lua = new Lua();

            lua.DynamicContext.print = (LuaFunction)print;
            lua.DynamicContext.read  = (LuaFunction)read;

            MathLibrary.AddMathLibrary(lua.Context);
            IoLibrary.AddIoLibrary(lua.Context);

            dynamic l = new Lua();

            //var x = l.Context;
            l.print = (LuaFunction)print;
            l.read  = (LuaFunction)read;



            lua.DoFile("C:\\Users\\Francesco\\life.lua");

            while (true)
            {
                lua.DoString(Console.ReadLine());
                //l.DoString(Console.ReadLine());
            }
        }
Esempio n. 2
0
        public void MyTestInitialize()
        {
            TestAssert = new TestAssert();
            GuiHelper  = new GuiHelper();
            const string calcProcess = "ApplicationFrameHost";

            IoLibrary.KillProcess(calcProcess);
        }
        public static void VerifyDefaultState(TestAssert testAssert)
        {
            IoLibrary.WriteLine("Verifying Application Default State, and Menu Items.");
            Actions action       = new Actions(Driver);
            var     notePadTitle = Driver.Title;

            testAssert.Pass = LoggingLibrary.CompareResult(notePadTitle, "Untitled - Notepad");
            // verifying File Menu Items
            IoLibrary.WriteLine("Verifying Following File Menu Displayed: New, Open, Save, Save As..., Page Setup..., Print, Exit.");
            Driver.FindElementByName("File").Click();
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("New").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Open...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Save").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Save As...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Page Setup...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Print...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Exit").Displayed, true);

            IoLibrary.WriteLine("Verifying Following Edit Menu Displayed: Undo, Cut..., Copy, Paste, Delete, Find..., Find Next, Replace..., Go To..., Select All, Time/Date.");
            action.MoveToElement(Driver.FindElementByName("Edit")).Perform();
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Undo").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Cut").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Copy").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Paste").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Delete").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Find...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Find Next").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Replace...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Go To...").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Select All").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Time/Date").Displayed, true);

            IoLibrary.WriteLine("Verifying Following Format Menu Displayed: Word Wrap, Font...");
            action.MoveToElement(Driver.FindElementByName("Format")).Perform();
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Word Wrap").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Font...").Displayed, true);

            IoLibrary.WriteLine("Verifying Following View Menu Displayed: Status Bar");
            action.MoveToElement(Driver.FindElementByName("View")).Perform();
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("Status Bar").Displayed, true);

            IoLibrary.WriteLine("Verifying Following Help Menu Displayed: View Help, About Notepad");
            action.MoveToElement(Driver.FindElementByName("Help")).Perform();
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("View Help").Displayed, true);
            testAssert.Pass = LoggingLibrary.CompareResult(Driver.FindElementByName("About Notepad").Displayed, true);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Lua lua = new Lua();

            lua.DynamicContext.print = (LuaFunction)print;
            lua.DynamicContext.read  = (LuaFunction)read;

            MathLibrary.AddMathLibrary(lua.Context);
            IoLibrary.AddIoLibrary(lua.Context);

            lua.DoFile("life.lua");

            while (true)
            {
                lua.DoString(Console.ReadLine());
            }
        }
Esempio n. 5
0
 public void MyTestInitialize()
 {
     IoLibrary.KillProcess("chromedriver");
     IoLibrary.KillProcess("chrome");
     TestAssert = new TestAssert();
 }
 public void VerifyResults(TestAssert testAssert, String expectedResult)
 {
     IoLibrary.WriteLine("Verifying Calculator Results.");
     testAssert.Pass = LoggingLibrary.CompareResult(this.TxtResult.DisplayText, expectedResult);
 }
 public void VerifyWindowExist(TestAssert testAssert)
 {
     IoLibrary.WriteLine("Verifying Calculator Window Main Exists.");
     testAssert.Pass = LoggingLibrary.CompareResult(this.Exists, true);
 }