├── .gitignore
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── DotNetOutdated
└── DotNetOutdated.sln
├── LICENSE
├── README.md
├── demo.png
├── global.json
├── src
└── DotNetOutdated
│ ├── Dependency.cs
│ ├── DependencyStatus.cs
│ ├── DotNetOutdated.csproj
│ ├── HttpNuGetClient.cs
│ ├── PackageInfo.cs
│ ├── Program.cs
│ ├── ProjectParser.cs
│ ├── TableParser.cs
│ └── V3NuGetClient.cs
└── test
└── DotNetOutdated.Test
├── DependencyStatusTest.cs
├── DotNetOutdated.Test.csproj
├── FileSystemNuGetClient.cs
├── MissingPackageNuGetClient.cs
├── NuGetClientTest.cs
├── ProjectParserTest.cs
├── nuget-responses
├── nlog
│ └── index.json
├── selenium.webdriver
│ └── index.json
├── serilog
│ ├── index.json
│ └── page
│ │ ├── 0.1.6
│ │ └── 1.2.47.json
│ │ ├── 1.2.48
│ │ └── 1.4.34.json
│ │ ├── 1.4.39
│ │ └── 2.0.0-beta-541.json
│ │ └── 2.0.0-rc-556
│ │ └── 2.4.0-dev-00746.json
└── sharpsaprfc
│ └── index.json
└── sample-projects
├── complex.csproj1
├── framework-dependencies.csproj1
├── no-dependencies.csproj1
├── single-dependency.csproj1
└── tools.csproj1
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | .vs
4 | *.user
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": ".NET Core Launch (console)",
6 | "type": "coreclr",
7 | "request": "launch",
8 | "preLaunchTask": "build",
9 | "program": "${workspaceFolder}/src/DotNetOutdated/bin/Debug/netcoreapp2.0/dotnet-outdated.dll",
10 | "args": [],
11 | "cwd": "${workspaceFolder}/src/DotNetOutdated"
12 | },
13 | {
14 | "name": ".NET Core Attach",
15 | "type": "coreclr",
16 | "request": "attach",
17 | "processId": "${command:pickProcess}"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "editor.tabSize": 4,
4 | "files.exclude": {
5 | "**/bin": true,
6 | "**/obj": true
7 | }
8 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/src/DotNetOutdated"
11 | ],
12 | "problemMatcher": "$msCompile",
13 | "group": {
14 | "kind": "build",
15 | "isDefault": true
16 | }
17 | },
18 | {
19 | "label": "test",
20 | "command": "dotnet",
21 | "type": "process",
22 | "args": [
23 | "test",
24 | "${workspaceFolder}/test/DotNetOutdated.Test"
25 | ],
26 | "problemMatcher": "$msCompile",
27 | "group": {
28 | "kind": "test",
29 | "isDefault": true
30 | }
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/DotNetOutdated/DotNetOutdated.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2018
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetOutdated", "..\src\DotNetOutdated\DotNetOutdated.csproj", "{4ABC171B-A872-405F-8E77-71D5297B2E17}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetOutdated.Test", "..\test\DotNetOutdated.Test\DotNetOutdated.Test.csproj", "{032A704D-8866-48F5-88E1-567138CAA74C}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {4ABC171B-A872-405F-8E77-71D5297B2E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {4ABC171B-A872-405F-8E77-71D5297B2E17}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {4ABC171B-A872-405F-8E77-71D5297B2E17}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {4ABC171B-A872-405F-8E77-71D5297B2E17}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {032A704D-8866-48F5-88E1-567138CAA74C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {032A704D-8866-48F5-88E1-567138CAA74C}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {032A704D-8866-48F5-88E1-567138CAA74C}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {032A704D-8866-48F5-88E1-567138CAA74C}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {68941CD5-11EE-49DC-945E-0432EC63BFAB}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 Guilherme Oenning
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | dotnet-outdated
2 | ===
3 |
4 | `dotnet-outdated` is a tool to check for outdated .NET Core dependencies.
5 |
6 | ### How To Install
7 |
8 | Add `DotNetOutdated` as `DotNetCliToolReference` to your `.csproj` file:
9 |
10 | ```
11 |
12 | ```
13 |
14 | ### How To Use
15 |
16 | ```
17 | dotnet outdated
18 | ```
19 |
20 | ### An example of what to expect
21 |
22 | 
23 |
24 | `Yellow` is for non-major version available to update. It's generally safe to update so you should do it.
25 |
26 | `Red` is for new **MAJOR** update which may possible break something in your code. You should read the docs before updating.
--------------------------------------------------------------------------------
/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/goenning/dotnet-outdated/c16bc0e9dd0d87048840039198ccce22a952cc1c/demo.png
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "projects": [
3 | "src",
4 | "test"
5 | ]
6 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/Dependency.cs:
--------------------------------------------------------------------------------
1 | using NuGet.Versioning;
2 | using System;
3 |
4 | namespace DotNetOutdated
5 | {
6 | public class Dependency : IEquatable
7 | {
8 | public string Name { get; private set; }
9 | public SemanticVersion CurrentVersion { get; private set; }
10 |
11 | public Dependency(string name, string current)
12 | : this(name, SemanticVersion.Parse(current))
13 | {
14 | }
15 |
16 | public Dependency(string name, SemanticVersion current)
17 | {
18 | this.Name = name;
19 | this.CurrentVersion = current;
20 | }
21 |
22 | public bool Equals(Dependency other)
23 | {
24 | if(other == null) return false;
25 |
26 | return Name == other.Name &&
27 | CurrentVersion == other.CurrentVersion;
28 | }
29 |
30 | public override bool Equals(object obj)
31 | {
32 | if (ReferenceEquals(null, obj)) return false;
33 | if (ReferenceEquals(this, obj)) return true;
34 | if (obj.GetType() != GetType()) return false;
35 | return Equals(obj as Dependency);
36 | }
37 |
38 | public override int GetHashCode()
39 | {
40 | unchecked {
41 | var hashCode = 13;
42 | hashCode = (hashCode * 397) ^ Name.GetHashCode();
43 | hashCode = (hashCode * 397) ^ CurrentVersion.GetHashCode();
44 | return hashCode;
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/DependencyStatus.cs:
--------------------------------------------------------------------------------
1 | using NuGet.Versioning;
2 | using System.Linq;
3 |
4 | namespace DotNetOutdated
5 | {
6 | public class DependencyStatus
7 | {
8 | public PackageInfo Package { get; private set; }
9 | public Dependency Dependency { get; private set; }
10 | public SemanticVersion WantedVersion { get; private set; }
11 | public SemanticVersion StableVersion { get; private set; }
12 | public SemanticVersion LatestVersion { get; private set; }
13 |
14 | private DependencyStatus()
15 | {
16 |
17 | }
18 |
19 | public static DependencyStatus Check(Dependency dependency, PackageInfo package)
20 | {
21 | var status = new DependencyStatus();
22 | status.Dependency = dependency;
23 | status.Package = package;
24 |
25 | foreach(var version in package.Versions)
26 | {
27 | if (status.LatestVersion == null)
28 | status.LatestVersion = version;
29 |
30 | if (!version.IsPrerelease && status.StableVersion == null)
31 | {
32 | status.WantedVersion = version;
33 | status.StableVersion = version;
34 | }
35 | }
36 |
37 | if (dependency.CurrentVersion > status.WantedVersion)
38 | status.WantedVersion = dependency.CurrentVersion;
39 |
40 | if (status.WantedVersion.Major > dependency.CurrentVersion.Major)
41 | status.WantedVersion = package.Versions.FirstOrDefault(x => !x.IsPrerelease && x.Major == dependency.CurrentVersion.Major);
42 |
43 | return status;
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/DotNetOutdated.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Command line tool to check for outdated dependencies within your project.
5 | DotNet Outdated
6 | 2.0.0
7 | Guilherme Oenning
8 | netcoreapp2.0
9 | true
10 | dotnet-outdated
11 | Exe
12 | DotNetOutdated
13 | dotnet;nuget;dependencies;outdated
14 | https://github.com/goenning/dotnet-outdated
15 | https://raw.githubusercontent.com/goenning/dotnet-outdated/master/LICENSE
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/DotNetOutdated/HttpNuGetClient.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Net;
3 | using System.Net.Http;
4 | using System.Threading.Tasks;
5 | using Newtonsoft.Json.Linq;
6 |
7 | namespace DotNetOutdated
8 | {
9 | public class HttpNuGetClient : V3NuGetClient
10 | {
11 | private readonly HttpClient _httpClient;
12 |
13 | public HttpNuGetClient(HttpClient httpClient)
14 | {
15 | _httpClient = httpClient;
16 | }
17 |
18 | protected override async Task GetResource(string name)
19 | {
20 | var response = await _httpClient.GetAsync($"https://api.nuget.org/v3/registration3/{name}");
21 |
22 | if (response.IsSuccessStatusCode)
23 | {
24 | return JObject.Parse(await response.Content.ReadAsStringAsync());
25 | }
26 | return null;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/PackageInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using NuGet.Versioning;
4 |
5 | namespace DotNetOutdated
6 | {
7 | public class PackageInfo
8 | {
9 | public string Name { get; private set; }
10 | public IEnumerable Versions { get; private set; }
11 |
12 | public PackageInfo(string name, IEnumerable versions)
13 | : this(name, versions.Select(v => SemanticVersion.Parse(v)))
14 | {
15 |
16 | }
17 |
18 | public PackageInfo(string name, IEnumerable versions)
19 | {
20 | this.Name = name;
21 | this.Versions = versions;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Net.Http;
6 | using System.Threading.Tasks;
7 |
8 | namespace DotNetOutdated
9 | {
10 | public class Program
11 | {
12 | public static void Main(string[] args)
13 | {
14 | string firstProjectFile = Directory.EnumerateFiles("./").FirstOrDefault(x => Path.GetExtension(x) == ".csproj");
15 |
16 | if (firstProjectFile == null)
17 | {
18 | Console.WriteLine("No project file found");
19 | return;
20 | }
21 |
22 | var data = new List();
23 |
24 | using (var httpClient = new HttpClient())
25 | {
26 | var dependencies = ProjectParser.GetAllDependencies(firstProjectFile);
27 | var client = new HttpNuGetClient(httpClient);
28 | var requests = dependencies.Select(x => client.GetPackageInfo(x.Name));
29 | var responses = Task.WhenAll(requests).Result.Where(response => response != null).ToArray();
30 | for (int i = 0; i < responses.Length; i++)
31 | {
32 | var dependency = dependencies.ElementAt(i);
33 | var package = responses[i];
34 | var status = DependencyStatus.Check(dependency, package);
35 |
36 | if (status.LatestVersion > status.Dependency.CurrentVersion)
37 | {
38 | data.Add(status);
39 | }
40 | }
41 | }
42 |
43 |
44 | data.ToStringTable(
45 | new[] { "Package", "Current", "Wanted", "Stable", "Latest"},
46 | r => {
47 | if (r.Dependency.CurrentVersion < r.WantedVersion)
48 | return ConsoleColor.Yellow;
49 |
50 | if (r.Dependency.CurrentVersion == r.WantedVersion &&
51 | r.Dependency.CurrentVersion < r.StableVersion)
52 | return ConsoleColor.Red;
53 |
54 | return ConsoleColor.White;
55 | },
56 | a => a.Package.Name,
57 | a => a.Dependency.CurrentVersion,
58 | a => a.WantedVersion,
59 | a => a.StableVersion,
60 | a => a.LatestVersion
61 | );
62 | Console.ResetColor();
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/ProjectParser.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using Newtonsoft.Json.Linq;
3 | using System.Collections.Generic;
4 | using System.Xml.Linq;
5 |
6 | namespace DotNetOutdated
7 | {
8 | public static class ProjectParser
9 | {
10 | public static IEnumerable GetAllDependencies(string filePath)
11 | {
12 | var all = new HashSet();
13 | var project = File.ReadAllText(filePath);
14 | var document = XDocument.Parse(project);
15 |
16 | var dependencies = document.Descendants("PackageReference");
17 |
18 | foreach (var package in dependencies)
19 | {
20 | Dependency dependency = Extract(package);
21 |
22 | if (dependency != null)
23 | {
24 | all.Add(dependency);
25 | }
26 | }
27 |
28 | dependencies = document.Descendants("DotNetCliToolReference");
29 |
30 | foreach (var package in dependencies)
31 | {
32 | Dependency dependency = Extract(package);
33 |
34 | if (dependency != null)
35 | {
36 | all.Add(dependency);
37 | }
38 | }
39 |
40 | return all;
41 | }
42 |
43 | private static Dependency Extract(XElement element)
44 | {
45 | string name = element.Attribute("Include")?.Value;
46 | string version = element.Attribute("Version")?.Value;
47 |
48 | if (name != null && version != null)
49 | {
50 | return new Dependency(name, version);
51 | }
52 |
53 | return null;
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/TableParser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 |
6 | // Kudos to @HuBeZa
7 | // Highly based on http://stackoverflow.com/questions/856845/how-to-best-way-to-draw-table-in-console-app-c
8 |
9 | namespace DotNetOutdated
10 | {
11 | public static class TableParser
12 | {
13 | public static void ToStringTable(
14 | this IEnumerable values,
15 | string[] columnHeaders,
16 | Func colorSelector,
17 | params Func[] valueSelectors)
18 | {
19 | ToStringTable(values.ToArray(), columnHeaders, colorSelector, valueSelectors);
20 | }
21 |
22 | public static void ToStringTable(
23 | this T[] values,
24 | string[] columnHeaders,
25 | Func colorSelector,
26 | params Func[] valueSelectors)
27 | {
28 | Debug.Assert(columnHeaders.Length == valueSelectors.Length);
29 | var colors = new ConsoleColor[values.Length];
30 |
31 | var arrValues = new string[values.Length + 1, valueSelectors.Length];
32 |
33 | // Fill headers
34 | for (int colIndex = 0; colIndex < arrValues.GetLength(1); colIndex++)
35 | {
36 | arrValues[0, colIndex] = columnHeaders[colIndex];
37 | }
38 |
39 | // Fill table rows
40 | for (int rowIndex = 1; rowIndex < arrValues.GetLength(0); rowIndex++)
41 | {
42 | colors[rowIndex - 1] = colorSelector.Invoke(values[rowIndex - 1]);
43 | for (int colIndex = 0; colIndex < arrValues.GetLength(1); colIndex++)
44 | {
45 | arrValues[rowIndex, colIndex] = Convert.ToString(valueSelectors[colIndex].Invoke(values[rowIndex - 1]));
46 | }
47 | }
48 |
49 | ToStringTable(arrValues, colors);
50 | }
51 |
52 | private static void ToStringTable(this string[,] arrValues, ConsoleColor[] colors)
53 | {
54 | int[] maxColumnsWidth = GetMaxColumnsWidth(arrValues);
55 | var headerSpliter = new string('-', maxColumnsWidth.Sum(i => i + 3) - 1);
56 |
57 | for (int rowIndex = 0; rowIndex < arrValues.GetLength(0); rowIndex++)
58 | {
59 |
60 | for (int colIndex = 0; colIndex < arrValues.GetLength(1); colIndex++)
61 | {
62 | // Print cell
63 | string cell = arrValues[rowIndex, colIndex];
64 | cell = cell.PadRight(maxColumnsWidth[colIndex]);
65 |
66 | Console.Write(" | ");
67 | if (rowIndex > 0)
68 | Console.ForegroundColor = colors[rowIndex - 1];
69 | Console.Write(cell);
70 | Console.ResetColor();
71 | }
72 |
73 | // Print end of line
74 | Console.Write(" | ");
75 | Console.WriteLine();
76 |
77 | // Print splitter
78 | if (rowIndex == 0)
79 | {
80 | Console.Write(" |{0}| ", headerSpliter);
81 | Console.WriteLine();
82 | }
83 | }
84 |
85 | Console.WriteLine();
86 | }
87 |
88 | private static int[] GetMaxColumnsWidth(string[,] arrValues)
89 | {
90 | var maxColumnsWidth = new int[arrValues.GetLength(1)];
91 | for (int colIndex = 0; colIndex < arrValues.GetLength(1); colIndex++)
92 | {
93 | for (int rowIndex = 0; rowIndex < arrValues.GetLength(0); rowIndex++)
94 | {
95 | int newLength = arrValues[rowIndex, colIndex].Length;
96 | int oldLength = maxColumnsWidth[colIndex];
97 |
98 | if (newLength > oldLength)
99 | {
100 | maxColumnsWidth[colIndex] = newLength;
101 | }
102 | }
103 | }
104 |
105 | return maxColumnsWidth;
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/src/DotNetOutdated/V3NuGetClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using Newtonsoft.Json.Linq;
5 | using NuGet.Versioning;
6 | using System.Linq;
7 |
8 | namespace DotNetOutdated
9 | {
10 | public abstract class V3NuGetClient
11 | {
12 | protected abstract Task GetResource(string name);
13 |
14 | public async Task GetPackageInfo(string packageName)
15 | {
16 | var json = await this.GetResource($"{packageName.ToLower()}/index.json");
17 |
18 | if (json == null)
19 | {
20 | return null;
21 | }
22 | var versions = new List();
23 |
24 | var items = json["items"].AsJEnumerable();
25 | if (items[0]["items"] != null)
26 | {
27 | foreach (var item in items) {
28 | versions.AddRange(this.ExtractVersions(item["items"]));
29 | }
30 | }
31 | else
32 | {
33 | var requests = items.Select(i => {
34 | var id = i["@id"].ToString();
35 | var resourceName = id.Substring(id.IndexOf(packageName.ToLower()));
36 | return this.GetResource(resourceName);
37 | });
38 |
39 | var pages = await Task.WhenAll(requests);
40 | foreach(var page in pages)
41 | versions.AddRange(this.ExtractVersions(page["items"]));
42 | }
43 |
44 | versions.Reverse();
45 | return new PackageInfo(packageName, versions);
46 | }
47 |
48 | private IEnumerable ExtractVersions(JToken items)
49 | {
50 | foreach (var item in items)
51 | {
52 | bool listed = Convert.ToBoolean(item["catalogEntry"]["listed"].ToString());
53 | if (!listed)
54 | continue;
55 |
56 | SemanticVersion version;
57 | if (SemanticVersion.TryParse(item["catalogEntry"]["version"].ToString(), out version))
58 | yield return version;
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/test/DotNetOutdated.Test/DependencyStatusTest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using NuGet.Versioning;
3 | using Xunit;
4 |
5 | namespace DotNetOutdated.Test
6 | {
7 | public class DependencyStatusTest
8 | {
9 |
10 | private static PackageInfo DotNetOutdatedPackage = new PackageInfo("DotNetOutdated", new string[] { "1.0.1", "1.0.0" });
11 | private static PackageInfo SharpSapRfcPackage = new PackageInfo("SharpSapRfc", new string[] { "2.0.10", "1.0.2", "1.0.0" });
12 | private static PackageInfo SomeOtherPackagePackage = new PackageInfo("SomeOtherPackage", new string[] { "3.0.0-rc2", "2.1.3", "2.1.0-rc1", "2.1.0", "1.0.0-preview2-final", "1.0.0" });
13 |
14 | [Theory, MemberData("TestData")]
15 | public void CheckVerions(PackageInfo package, string current, string wanted, string stable, string latest)
16 | {
17 | var status = DependencyStatus.Check(new Dependency(package.Name, current), package);
18 | Assert.Equal(SemanticVersion.Parse(wanted), status.WantedVersion);
19 | Assert.Equal(SemanticVersion.Parse(latest), status.LatestVersion);
20 | Assert.Equal(SemanticVersion.Parse(stable), status.StableVersion);
21 | }
22 | public static IEnumerable