Пример #1
0
 public void TestEmptyCtr()
 {
     var obj = new RemoteLRS();
     Assert.IsInstanceOf<RemoteLRS>(obj);
     Assert.IsNull(obj.endpoint);
     Assert.IsNull(obj.auth);
     Assert.IsNull(obj.version);
 }
Пример #2
0
        public void Init()
        {
            Console.WriteLine("Running " + TestContext.CurrentContext.Test.FullName);

            //
            // these are credentials used by the other OSS libs when building via Travis-CI
            // so are okay to include in the repository, if you wish to have access to the
            // results of the test suite then supply your own endpoint, username, and password
            //
            lrs = new RemoteLRS(
                "https://cloud.scorm.com/tc/U2S4SI5FY0/sandbox/",
                "Nja986GYE1_XrWMmFUE",
                "Bd9lDr1kjaWWY6RID_4"
            );
        }
        public void Init()
        {
            Console.WriteLine("Running " + TestContext.CurrentContext.Test.FullName);
            lrs = new RemoteLRS(
                "",
                "",
                ""
            );

            agent = new Agent();
            agent.mbox = "mailto:[email protected]";

            verb = new Verb("http://adlnet.gov/expapi/verbs/experienced");
            verb.display = new LanguageMap();
            verb.display.Add("en-US", "experienced");

            activity = new Activity();
            activity.id = new Uri("http://tincanapi.com/TinCanCSharp/Test/Unit/0");
            activity.definition = new ActivityDefinition();
            activity.definition.type = new Uri("http://id.tincanapi.com/activitytype/unit-test");
            activity.definition.name = new LanguageMap();
            activity.definition.name.Add("en-US", "Tin Can C# Tests: Unit 0");
            activity.definition.description = new LanguageMap();
            activity.definition.description.Add("en-US", "Unit test 0 in the test suite for the Tin Can C# library.");

            parent = new Activity();
            parent.id = new Uri("http://tincanapi.com/TinCanCSharp/Test");
            parent.definition = new ActivityDefinition();
            parent.definition.type = new Uri("http://id.tincanapi.com/activitytype/unit-test-suite");
            //parent.definition.moreInfo = new Uri("http://rusticisoftware.github.io/TinCanCSharp/");
            parent.definition.name = new LanguageMap();
            parent.definition.name.Add("en-US", "Tin Can C# Tests");
            parent.definition.description = new LanguageMap();
            parent.definition.description.Add("en-US", "Unit test suite for the Tin Can C# library.");

            statementRef = new StatementRef(Guid.NewGuid());

            context = new Context();
            context.registration = Guid.NewGuid();
            context.statement = statementRef;
            context.contextActivities = new ContextActivities();
            context.contextActivities.parent = new List<Activity>();
            context.contextActivities.parent.Add(parent);

            score = new Score();
            score.raw = 97;
            score.scaled = 0.97;
            score.max = 100;
            score.min = 0;

            result = new Result();
            result.score = score;
            result.success = true;
            result.completion = true;
            result.duration = new TimeSpan(1, 2, 16, 43);

            subStatement = new SubStatement();
            subStatement.actor = agent;
            subStatement.verb = verb;
            subStatement.target = parent;
        }