public async Task TestInvalidAsyncPattern()
 {
     // it is enough to test if the fail-path is working in generall
     // detailed testing is done for the Sync. method, as both call the same function
     GithubUpdateCheck obj = new GithubUpdateCheck("", "");
     await obj.IsUpdateAvailableAsync("invalid1..0.0.00..");
 }
예제 #2
0
        public async Task TestInvalidUserAsync()
        {
            // random uuid, high change for non-existent repo
            GithubUpdateCheck obj = new GithubUpdateCheck("5fe54fd3-2fd8-48ff-8f63-1b8575348b5f", "GithubUpdateCheck");

            Assert.IsFalse(await obj.IsUpdateAvailableAsync("1.0.0.0"));
        }
예제 #3
0
        public async Task TestInvalidRepositoryAsync()
        {
            // random uuid, high change for non-existent repo
            GithubUpdateCheck obj = new GithubUpdateCheck("Mayerch1", "cb91fb82-9621-479a-9c5a-23e565e6390d");

            Assert.IsFalse(await obj.IsUpdateAvailableAsync("1.0.0.0"));
        }
예제 #4
0
        public async Task TestAsyncRequest()
        {
            GithubUpdateCheck obj = new GithubUpdateCheck("Mayerch1", "TheDiscordSoundboard");

            // it cannot be guaranteed, that the major version of TDS will stay at 2
            // more specific compares cannot be made
            Assert.IsTrue(await obj.IsUpdateAvailableAsync("1.0.0", VersionChange.Major));
        }
예제 #5
0
        private async void InitAsync()
        {
            await TryLoginAsync();
            await UpdateLiveryListAsync();

            if (await repo.IsUpdateAvailableAsync(version, VersionChange.Minor))
            {
                Lbl_Info.Content          = "Update available";
                TabItem_Update.Visibility = Visibility.Visible;
            }
        }
예제 #6
0
        private static async Task <bool> checkVersion()
        {
            var updateChecker = new GithubUpdateCheck(Handle.author, Handle.repo);

            return(await updateChecker.IsUpdateAvailableAsync(Handle.version, Mayerch1.GithubUpdateCheck.VersionChange.Revision));
        }