diff --git a/test/Microsoft.Framework.Runtime.Tests/GacDependencyResolverFacts.cs b/test/Microsoft.Framework.Runtime.Tests/GacDependencyResolverFacts.cs new file mode 100644 index 000000000..d43781187 --- /dev/null +++ b/test/Microsoft.Framework.Runtime.Tests/GacDependencyResolverFacts.cs @@ -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); + } + } + } +} \ No newline at end of file diff --git a/test/Microsoft.Framework.Runtime.Tests/project.json b/test/Microsoft.Framework.Runtime.Tests/project.json index 5d005c538..418ccf3f2 100644 --- a/test/Microsoft.Framework.Runtime.Tests/project.json +++ b/test/Microsoft.Framework.Runtime.Tests/project.json @@ -2,6 +2,7 @@ "dependencies": { "Microsoft.Framework.Runtime": "1.0.0-*", "Microsoft.Framework.Runtime.Interfaces": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "frameworks": {