Ejemplo n.º 1
0
        public void ByIsCorrectResponseTest()
        {
            this.SchoolNet().LoadWebPage();
            int            index    = 0;
            string         uniqueId = "ctl01";
            AnswerLineItem form     = new AnswerLineItem(index, uniqueId, ItemType.Matching);

            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_pairsRepeator_" + uniqueId + "_chkIsCorrect",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.MultipleChoice);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterAnswers_" + uniqueId + "_CheckBoxCorrect",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.TrueFalse);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterAnswers_" + uniqueId + "_CheckBoxCorrect",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.InlineResponse);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterClozeStemAnswers_" + uniqueId + "_CheckBoxCorrect",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.DragAndDrop);
            Assert.AreEqual("By.CssSelector: .tab-pane.ng-scope.active .listChoices li[data-ng-repeat='tabChoice in tab.AllChoices']:nth-of-type(" + index + ") .checkbox > input",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.HotSpotSingleSelection);
            Assert.AreEqual("By.CssSelector: #tblAnswers tbody[ng-repeat='answer in TestItem.Answers']:nth-of-type(" + index + ") .checkbox > input",
                            form.ByIsCorrectResponse().ToString(), "ByIsCorrectResponse locator matches");
        }
Ejemplo n.º 2
0
        public void ByRemoveLineTest()
        {
            this.SchoolNet().LoadWebPage();
            int            index    = 0;
            string         uniqueId = "ctl01";
            AnswerLineItem form     = new AnswerLineItem(index, uniqueId, ItemType.Matching);

            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_choicesRepeator_" + uniqueId + "_lnkDeleteChoice",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.MultipleChoice);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterAnswers_" + uniqueId + "_LinkButton1",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.TrueFalse);
            Assert.AreEqual("By.Id: ",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.InlineResponse);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterClozeStemAnswers_" + uniqueId + "_DelClozeChoice",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.DragAndDrop);
            Assert.AreEqual("By.CssSelector: ",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");

            form = new AnswerLineItem(index, uniqueId, ItemType.HotSpotSingleSelection);
            Assert.AreEqual("By.CssSelector: #tblAnswers tbody[ng-repeat='answer in TestItem.Answers']:nth-of-type(" + index + ") .pull-right > a",
                            form.ByRemoveLine().ToString(), "ByRemoveLine locator matches");
        }
Ejemplo n.º 3
0
        public void AnswerLineItemTest()
        {
            this.SchoolNet().LoadWebPage();
            AnswerLineItem answerLineItem = new AnswerLineItem(0, "ctl01", ItemType.TrueFalse);

            Assert.AreEqual(0, answerLineItem.Index);
            Assert.AreEqual("ctl01", answerLineItem.UniqueId);
        }