This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test cover GacDependencyResolver.GetDescription
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
test/Microsoft.Framework.Runtime.Tests/GacDependencyResolverFacts.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.AspNet.Testing.xunit; | ||
using Microsoft.Framework.Runtime.Helpers; | ||
using NuGet; | ||
using Xunit; | ||
|
||
namespace Microsoft.Framework.Runtime.Tests | ||
{ | ||
public class GacDependencyResolverFacts | ||
{ | ||
[ConditionalTheory] | ||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)] | ||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] | ||
[InlineData("mscorlib", "4.0.0.0", "dnx451", true)] | ||
[InlineData("mscorlib", "1.0.0.0", "dnx451", false)] | ||
[InlineData("mscorlib", "4.0.0.0", "dnxcore50", false)] | ||
public void GetDescriptionReturnsCorrectResults(string name, string version, string framework, bool found) | ||
{ | ||
var libraryRange = new LibraryRange() | ||
{ | ||
Name = name, | ||
VersionRange = VersionUtility.ParseVersionRange(version), | ||
IsGacOrFrameworkReference = true | ||
}; | ||
|
||
var frameworkName = FrameworkNameHelper.ParseFrameworkName(framework); | ||
var resolver = new GacDependencyResolver(); | ||
var library = resolver.GetDescription(libraryRange, frameworkName); | ||
|
||
if (found) | ||
{ | ||
Assert.NotNull(library); | ||
Assert.Equal(SemanticVersion.Parse(version), library.Identity.Version); | ||
} | ||
else | ||
{ | ||
Assert.Null(library); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters