Exemplo n.º 1
0
        public async void BasicDeserialization_18_1()
        {
            String targetPath = await Storage.Instance.GetFolderPath(Storage.Instance.folder) + "\\";

            String sourceFolder = TestHelper.testDataLocation + "\\SampleDataFiles\\18_1\\";

            File.Copy(sourceFolder + "sessions.xml", targetPath + "sessions.xml");
            File.Copy(sourceFolder + "userdetails.xml", targetPath + "userdetails.xml");
            File.Copy(sourceFolder + "events.xml", targetPath + "events.xml");
            File.Copy(sourceFolder + "exceptions.xml", targetPath + "exceptions.xml");
            File.Copy(sourceFolder + "devicePCL.xml", targetPath + "device.xml");

            Countly.Instance.deferUpload = true;
            await CountlyImpl.StartLegacyCountlySession(ServerInfo.serverURL, ServerInfo.appKey, ServerInfo.appVersion);

            Assert.Equal(50, Countly.Instance.Events.Count);
            Assert.Equal(50, Countly.Instance.Exceptions.Count);
            Assert.Equal(3, Countly.Instance.Sessions.Count);
            Assert.Empty(Countly.Instance.StoredRequests);
            Assert.Equal("B249FB85668941FAA8301E2A5CA95901", await Countly.GetDeviceId());

            CountlyUserDetails cud = Countly.UserDetails;

            Assert.Equal(56, cud.BirthYear);
            Assert.Equal("f", cud.Email);
            Assert.Equal("t", cud.Gender);
            Assert.Equal("g", cud.Name);
            Assert.Equal("s", cud.Organization);
            Assert.Equal("p", cud.Phone);
            Assert.Equal("1t", cud.Picture);
            Assert.Equal("u", cud.Username);
        }
Exemplo n.º 2
0
        public async void LegacyInitSimpleFail()
        {
            Exception exToCatch = null;

            try
            {
                await CountlyImpl.StartLegacyCountlySession(null, "234", "345");
            }
            catch (Exception ex) { exToCatch = ex; }

            Assert.NotNull(exToCatch);
            exToCatch = null;
            Countly.Halt();

            try
            {
                await CountlyImpl.StartLegacyCountlySession("123", null, "345");
            }
            catch (Exception ex) { exToCatch = ex; }

            Assert.NotNull(exToCatch);
            exToCatch = null;
            Countly.Halt();

            try
            {
                await CountlyImpl.StartLegacyCountlySession(null, null, null);
            }
            catch (Exception ex) { exToCatch = ex; }

            Assert.NotNull(exToCatch);
            exToCatch = null;
        }
 /// <summary>
 /// Test setup
 /// </summary>
 public LegacyInitTests()
 {
     CountlyImpl.SetPCLStorageIfNeeded();
     Countly.Halt();
     TestHelper.CleanDataFiles();
     CountlyImpl.StartLegacyCountlySession(ServerInfo.serverURL, ServerInfo.appKey, ServerInfo.appVersion).Wait();
 }
Exemplo n.º 4
0
        public async void LegacyInitSimple()
        {
            await CountlyImpl.StartLegacyCountlySession("123", "234", "345");

            await Countly.EndSession();
        }