Exemple #1
0
        public async void TestRefreshInstallationNormalSaved()
        {
            // Save Installation
            await ITUtil.UpsertInstallation();

            NbSsePushInstallation currentInstallation = NbSsePushInstallation.GetCurrentInstallation();
            var channels       = currentInstallation.Channels;
            var allowedSenders = currentInstallation.AllowedSenders;
            var owner          = currentInstallation.Owner;
            var options        = currentInstallation.Options;

            // Change Strorage Data
            var json = ITUtil.GetJsonFromStorage();

            json["options"] = null;
            ITUtil.SaveJsonToStorage(json);

            // Main
            var result = await NbSsePushInstallation.RefreshCurrentInstallation();

            // Check Response
            ITUtil.CheckCommonResponse(result);
            Assert.AreEqual(channels, result.Channels);
            Assert.AreEqual(allowedSenders, result.AllowedSenders);
            Assert.AreEqual(owner, result.Owner);
            Assert.AreEqual(options, result.Options);

            // Check Storage
            ITUtil.CheckSaveStorage(result);
        }