Пример #1
0
        public void Test()
        {
            FirstSessionProvider provider = new FirstSessionProvider();

            try {
                provider.GetSession().FindById("ASdASD");
                Assert.IsTrue(false);
            }
            catch (InvalidPathException) {
                Assert.IsTrue(true);
            }
        }
Пример #2
0
        public void TestSimple()
        {
            FirstSessionProvider provider = new FirstSessionProvider();
            var contextMock = new Mock <ActionContext>();
            var textMock    = new Mock <TextProvider>();
            FirstSessionProvider sessionProvider = new FirstSessionProvider();

            contextMock.Setup(context => context.GetSession()).Returns(sessionProvider.GetSession());
            textMock.Setup(text => text.GetText()).Returns("ABC");

            InputSetTextAction action = new InputSetTextAction(textMock.Object, "/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-BNAME");

            action.Execute(contextMock.Object);
        }
Пример #3
0
        public void CreateParameters()
        {
            FirstSessionProvider provider = new FirstSessionProvider();
            string id = "/app/con[0]/ses[0]/wnd[0]/usr/tabsCTS/tabpTAB_MTD/ssubCSS:SAPLSEOD:0352/tblSAPLSEODPC";


            GuiClassVariableFactory factory = new GuiClassVariableFactory(
                provider.GetSession().FindById(id) as GuiTableControl,
                new MethodParameterColumnDefinition()
                );
            List <SuggestionConsumer> list = factory.CreateParameters2();

            System.Console.WriteLine(list.Count);

            ParameterSignatureSuggestion suggestion = new MethodParameterSignatureSuggestion(new TestTypeSuggestion());

            suggestion.Suggest("IR_COMPONENT", list.ElementAt(5));
        }
Пример #4
0
        public void TestLogin()
        {
            var contextMock = new Mock <ActionContext>();
            FirstSessionProvider sessionProvider = new FirstSessionProvider();

            contextMock.Setup(context => context.GetSession()).Returns(sessionProvider.GetSession());
            var textMock = new Mock <TextProvider>();

            //User
            textMock.Setup(provider => provider.GetText()).Returns("plunz");
            new InputSetTextAction(textMock.Object, "/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-BNAME").Execute(contextMock.Object);

            //PW
            textMock.Setup(provider => provider.GetText()).Returns("epic321");
            new InputSetTextAction(textMock.Object, "/app/con[0]/ses[0]/wnd[0]/usr/pwdRSYST-BCODE").Execute(contextMock.Object);

            //Login
            new ButtonPressAction("/app/con[0]/ses[0]/wnd[0]/tbar[0]/btn[0]").Execute(contextMock.Object);
        }