Esempio n. 1
0
        private void LoadSharepointListAsAppend <T>(String listName, String query, IListItemConverter <T> converter, String sharepointName = null)
        {
            var isfirmware = false;

            if (sharepointName == SharepointKeys.FirmwareFiles)
            {
                isfirmware = true;
            }

            var convertedList = GetSharepointList(listName, query, converter, sharepointName, isfirmware);

            _storage.Append(listName, convertedList);
        }
Esempio n. 2
0
    public void TestTraceSendingSync()
    {
        initTracker("xapi", TrackerAsset.StorageTypes.net);
        storage.Delete("netstorage");

        enqueueTrace01();
        TrackerAsset.Instance.Flush();

        string text = storage.Load("netstorage");

        if (text.IndexOf("M\n") != -1)
        {
            text = text.Substring(text.IndexOf("M\n") + 2);
        }

        JSONNode file      = JSON.Parse(text);
        JSONNode tracejson = file[new List <JSONNode>(file.Children).Count - 1];

        Assert.AreEqual(new List <JSONNode>(tracejson.Children).Count, 4);
        Assert.AreEqual(tracejson["object"]["id"].Value, "http://a2:3000/api/proxy/gleaner/games/5a26cb5ac8b102008b41472a/5a26cb5ac8b102008b41472b/ObjectID");
        Assert.AreEqual(tracejson["object"]["definition"]["type"].Value, "https://w3id.org/xapi/seriousgames/activity-types/game-object");
        Assert.AreEqual(tracejson["verb"]["id"].Value, "https://w3id.org/xapi/seriousgames/verbs/accessed");

        storage.Append("netstorage", ",");
        enqueueTrace02();
        enqueueTrace03();
        TrackerAsset.Instance.Flush();

        text = storage.Load("netstorage");
        text = "[" + text + "]";
        file = JSON.Parse(text);

        Assert.AreEqual(new List <JSONNode>(file.Children).Count, 2);
        Assert.AreEqual(file[0].Count, 1);
        Assert.AreEqual(file[1].Count, 2);
    }