public void Throws_if_release_is_null() { var patient = new Evergreen("user", "repo"); const string currentVersion = "1.0.0"; Assert.Throws <ArgumentNullException>(() => patient.IsCurrent(currentVersion, null)); }
[InlineData("1.0.0.1", "v1.0.0")] // invalid semver public void IsCurrent_throws_on_invalid_semversions(string currentVersion, string tagVersion) { var patient = new Evergreen("user", "repo"); var version = CreateReleaseFromTag(tagVersion); Assert.Throws <ArgumentException>(() => patient.IsCurrent(currentVersion, version)); }
[InlineData("2.0.0", "v1.0.0", true)] // current version is higher than tag. Active development? public void IsCurrent_responds_correctly(string currentVersion, string tagVersion, bool isCurrent) { var patient = new Evergreen("user", "repo"); var version = CreateReleaseFromTag(tagVersion); Assert.Equal(isCurrent, patient.IsCurrent(currentVersion, version)); }
static void Main(string[] args) { Tree tree = new Tree(300, "Red", 65.34, 0); foreach (string loc in Tree.Locations) { } tree.DisplayDetails(); tree.Photosynthesize(); System.Console.WriteLine(tree.Location); if (tree.IsBigTree) { System.Console.WriteLine("Cool its a big tree!"); } Evergreen bigCedar = new Evergreen(400, 100); List <Tree> trees = new List <Tree>() { tree, bigCedar }; foreach (Tree t in trees) { t.Photosynthesize(); } }
public async Task Update() { await Evergreen.Update(Release); var notification = new Notification { Message = "Restart to update.", ImageUrl = "", Title = "Evergreen: Upate Complete" }; FrameworkApplication.AddNotification(notification); }
public void ShowVersion() { var versionInformation = Evergreen.GetCurrentAddInVersion(); var version = new Notification { Message = versionInformation.ToString(), ImageUrl = "", Title = "Evergreen" }; FrameworkApplication.AddNotification(version); }
/// <summary> /// Called when the addin initializes to check for updates and download the latest /// </summary> /// <returns>Task</returns> public static Task RunAsyncUpdateCheck() { return(QueuedTask.Run(async() => { // check current release and update it if there's a newer version var evergreen = new Evergreen("roemhildtg", "arcgis-pro-addins"); VersionInformation currentVersion = evergreen.GetCurrentAddInVersion(); Release latestVersion = await evergreen.GetLatestReleaseFromGithub(); if (!evergreen.IsCurrent(currentVersion.AddInVersion, latestVersion)) { await evergreen.Update(latestVersion); var notify = new ArcGIS.Desktop.Framework.Notification(); notify.Title = "Addin Update"; notify.Message = string.Format("Your pro-addins have been updated to version {0}. Please restart Pro to complete the update.", latestVersion.TagName); FrameworkApplication.AddNotification(notify); } })); }
private static void Main() { var updator = new Evergreen("steveoh", "pro-evergreen"); var release = updator.GetLatestReleaseFromGithub().Result; var version = updator.GetCurrentAddInVersion(); if (updator.IsCurrent(version.AddInVersion, release)) { return; } var assets = updator.Update(release).Result; // if (!updator.IsCompatible("currentProVersion", ".proversion from assets in release")) { // throw new Exception("incompatible versions of pro"); // } // // updator.Update(assets); }
public async Task CheckForUpdate() { Release = await Evergreen.GetLatestReleaseFromGithub(); var version = Evergreen.GetCurrentAddInVersion(); var notification = new Notification { Message = "You are up to date.", ImageUrl = "", Title = "Evergreen: Version Check" }; if (Evergreen.IsCurrent(version.AddInVersion, Release)) { FrameworkApplication.AddNotification(notification); return; } notification.Message = $"Release version {Release.TagName} is available"; FrameworkApplication.AddNotification(notification); }