Example #1
0
        public void TestGetLatestVersion()
        {
            var version = UpdateCheck.GetLatestVersion();

            if (version != null)
            {
                Assert.That(version, Is.Not.Empty);
            }
        }
Example #2
0
 private void Init()
 {
     versionLabel       = "Version : " + ProductInfoUtility.GetVersion();
     developerLinkTitle = ProductInfoUtility.GetDeveloperLinkTitle();
     developerLinkURL   = ProductInfoUtility.GetDeveloperLinkURL();
     if (UpdateCheck.Enabled)
     {
         var version = UpdateCheck.GetLatestVersion();
         if (version == null)
         {
             latestVersion = "None";
         }
         else
         {
             latestVersion = version;
         }
         latestVersionLabel = "Latest Version : " + latestVersion;
     }
 }
        protected override void Logic(ValidationTarget target)
        {
            if (!UpdateCheck.Enabled)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckのバージョンチェックが無効になっています。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var latestVersion = UpdateCheck.GetLatestVersion();

            if (latestVersion == null)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckの最新バージョン番号の取得に失敗しました。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var currentVersion = ProductInfoUtility.GetVersion();

            if (currentVersion != latestVersion)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Error,
                                  $"VitDeckが最新バージョンではありません。\n現在のバージョン: {currentVersion}\n最新バージョン: {latestVersion}",
                                  this.solution,
                                  this.solutionURL
                                  ));
            }
        }