Skip to content

Commit

Permalink
Only compare product version excluding pre-release part
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel committed Sep 13, 2019
1 parent 8330245 commit 3a36b62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/EFCore.Tests/ModelSourceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ public void Stores_model_version_information_as_annotation_on_model()
var packageVersion = typeof(Context1).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
.Single(m => m.Key == "PackageVersion").Value;

var prereleaseIndex = packageVersion.IndexOf("-", StringComparison.Ordinal);
if (prereleaseIndex != -1)
{
packageVersion = packageVersion.Substring(0, prereleaseIndex);
}

Assert.StartsWith(packageVersion, model.GetProductVersion(), StringComparison.OrdinalIgnoreCase);
}

Expand Down

0 comments on commit 3a36b62

Please sign in to comment.