Ejemplo n.º 1
0
        public void location()
        {
            LETSIRTE_Service client = getClient();

            Log("verify open attempt");
            attemptSummary[] attempts = client.GetAttemptList();
            if (entry.other == attempts[attempts.Length - 1].entry)
            {
                Assert.Ignore(string.Format("Current attempt for registration {0} is closed, registration is closed, test can't continue.", RegId));
            }

            Log("Location: " + client.Get().location);
            cocdType cocd     = new cocdType();
            string   location = Guid.NewGuid().ToString();

            cocd.location = location;
            client.Set(cocd);

            cocd = client.Get();
            Assert.AreEqual(location, cocd.location, "location");

            client.Set(new cocdType());
            cocd = client.Get();
            Assert.AreEqual(location, cocd.location, "location");

            location = "";

            cocd.location = location;
            client.Set(cocd);

            cocd = client.Get();
            Assert.AreEqual(location, cocd.location, "location");
        }
Ejemplo n.º 2
0
        public void getAttemptList()
        {
            LETSIRTE_Service client = getClient();

            attemptSummary[] attempts = client.GetAttemptList();
            foreach (attemptSummary att in attempts)
            {
                Log(att.ToString());
            }
        }
Ejemplo n.º 3
0
        //DE - Not even sure what this is testing, commenting out
        //[Test]
        public void generate()
        {
            LETSIRTE_Service client = getClient();

            Log("verify open attempt");
            attemptSummary[] attempts = client.GetAttemptList();
            if (entry.other == attempts[attempts.Length - 1].entry)
            {
                Assert.Ignore(string.Format("Current attempt for registration {0} is closed, registration is closed, test can't continue.", RegId));
            }

            Requests rq = new Requests();

            rq.interactionsFillIn();
            rq.interactionsLongFillIn();
            rq.interactionsPerformanceTest();
            rq.interactionsSequencing();
            rq.interactionsTest();
            clearTrace();

            // get
            cocdType cmi = client.Get();

            saveTrace("get", "");

            // set
            clearTrace();
            cmi.exit = exit.normal;
            cmi.attemptNumberSpecified = false;
            client.Set(cmi);
            saveTrace("set", "");

            // getattemptlist
            clearTrace();
            attempts = client.GetAttemptList();
            saveTrace("getAttemptList", "");

            //getAttempt
            clearTrace();
            client.GetAttempt(1);
            saveTrace("getAttempt", "");
        }
Ejemplo n.º 4
0
        public void workflow()
        {
            LETSIRTE_Service client = getClient();

            Log("verify open attempt");
            attemptSummary[] attempts = client.GetAttemptList();
            if (entry.other == attempts[attempts.Length - 1].entry)
            {
                Assert.Ignore(string.Format("Current attempt for registration {0} is closed, registration is closed, test can't continue.", RegId));
            }


            //- set values (suspend)
            set(exit.suspend);

            //- clear values (suspend)
            clear(exit.suspend);

            //- set values (normal)
            set(exit.normal);

            //- get list (verify)
            VerifyLast(entry.ab_initio, null, client);

            //- set values (close)
            set(exit.logout);

            //- get list (verify)
            VerifyLast(entry.other, NO_CHECK, client);

            Log(Environment.NewLine + "Trying to update locked registration, should fail.");
            try {
                set(exit.suspend);
                Assert.Fail("Set should have failed due to locked registration.");
            }
            catch (SoapException ex) {
                Log("Expected failure verified: " + ex.Message);
            }
            client     = new LETSIRTE_Service(RegId + System.Guid.NewGuid().ToString(), Secret);
            client.Url = URL;

            //- get wrong registration (verify fail)
            Log(Environment.NewLine + "Trying to get attempt list with invalid registration, should fail.");
            try {
                client.GetAttemptList();
                Assert.Fail("Set should have failed due to wrong registration.");
            }
            catch (SoapException ex) {
                Log("Expected failure verified: " + ex.Message);
            }
        }
Ejemplo n.º 5
0
        public void exit_tst()
        {
            LETSIRTE_Service client = getClient();

            Log("verify open attempt");
            attemptSummary[] attempts = client.GetAttemptList();
            if (entry.other == attempts[attempts.Length - 1].entry)
            {
                Assert.Ignore(string.Format("Current attempt for registration {0} is closed, registration is closed, test can't continue.", RegId));
            }

            //
            client.Set(new cocdType());
            Assert.AreEqual(entry.resume, client.Get().entry, "entry shoudl be resume after set w/o specified exit (default to suspend).");
        }
Ejemplo n.º 6
0
        private void clear(exit exitValue)
        {
            Log(Environment.NewLine + "performing current attempt clear, exit: " + exitValue + Environment.NewLine);
            LETSIRTE_Service client = getClient();
            cocdType         cmi    = client.Get();

            int expectedLength = cmi.attemptNumber;

            cmi.progressMeasure           = null;
            cmi.progressMeasureSpecified  = true;
            cmi.completionStatus          = completionStatusType.unknown;
            cmi.completionStatusSpecified = true;
            cmi.successStatus             = successStatusType.unknown;
            cmi.successStatusSpecified    = true;
            cmi.scoreScaled          = null;
            cmi.scoreScaledSpecified = true;
            cmi.exit          = exitValue;
            cmi.exitSpecified = true;

            client.Set(cmi);

            attemptSummary[] attempts = client.GetAttemptList();
            foreach (attemptSummary att in attempts)
            {
                Log(att.ToString());
            }

            //Did we create a new attempt?
            Boolean exitCreatedNewAttempt = (exitValue == exit.normal || exitValue == exit.Item);

            expectedLength += (exitCreatedNewAttempt ? 1 : 0);

            Assert.AreEqual(expectedLength, attempts.Length);

            attemptSummary latest = attempts[attempts.Length - (1 + (exitCreatedNewAttempt ? 1 : 0))];

            Assert.AreEqual(cmi.scoreScaled, latest.scoreScaled);
            Assert.AreEqual(cmi.successStatus, latest.successStatus);
            Assert.AreEqual(cmi.completionStatus, latest.completionStatus);
            Assert.AreEqual(cmi.progressMeasure, latest.progressMeasure);
            Assert.AreEqual(exitValue == exit.suspend ? entry.resume : entry.other, latest.entry);
            Log("verified clear");
        }
Ejemplo n.º 7
0
        private void VerifyLast(entry entryType, decimal?scoreScaled, LETSIRTE_Service client)
        {
            if (scoreScaled != NO_CHECK)
            {
                Log(string.Format("Verifying last attempt has entry: {0} and scaled score: {1}", entryType, scoreScaled));
            }
            else
            {
                Log(string.Format("Verifying last attempt has entry: {0}", entryType));
            }
            attemptSummary[] attempts = client.GetAttemptList();
            attemptSummary   summary  = attempts[attempts.Length - 1];

            Assert.AreEqual(entryType, summary.entry, "Latest attempt entry did not match");
            if (scoreScaled != NO_CHECK)
            {
                Assert.AreEqual(scoreScaled, summary.scoreScaled, "Latest attempt score scaled did not match");
            }
        }