Ejemplo n.º 1
0
        public void ByPointsPossibleTest()
        {
            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 + "_txtPointsPossible",
                            form.ByPointsPossible().ToString(), "ByPointsPossible locator matches");

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

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

            form = new AnswerLineItem(index, uniqueId, ItemType.InlineResponse);
            Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterClozeStemAnswers_" + uniqueId + "_txtAnswerPoints",
                            form.ByPointsPossible().ToString(), "ByPointsPossible 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 + ") .AnswerPoints",
                            form.ByPointsPossible().ToString(), "ByPointsPossible 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 + ") .AnswerPoints",
                            form.ByPointsPossible().ToString(), "ByPointsPossible locator matches");
        }