public void Should_Throw_If_Path_Is_Null()
        {
            // Given
            var fixture = new NuGetV2ContentResolverFixture();

            fixture.Path = null;

            // When
            var result = Record.Exception(() => fixture.GetFiles());

            // Then
            Assert.IsArgumentNullException(result, "path");
        }
        public void Should_Return_Empty_Result_If_Any_Match_Is_Not_Possible()
        {
            // Given
            var fixture = new NuGetV2ContentResolverFixture(".NETStandard,Version=v4.5");
            fixture.CreateCLRAssembly("/Working/lib/net451/file.dll");
            fixture.CreateCLRAssembly("/Working/lib/net452/file.dll");
            fixture.CreateCLRAssembly("/Working/lib/net461/file.dll");

            // When
            var result = fixture.GetFiles();

            // Then
            Assert.Equal(0, result.Count);
        }
        public void Should_Return_Only_CLR_Assemblies()
        {
            // Given
            var fixture = new NuGetV2ContentResolverFixture(".NETFramework,Version=v4.5.2");
            fixture.CreateCLRAssembly("/Working/lib/net451/file.dll");
            fixture.CreateNonCLRAssembly("/Working/lib/net451/lib/native.dll");

            // When
            var result = fixture.GetFiles();

            // Then
            Assert.Equal(1, result.Count);
            Assert.Equal("/Working/lib/net451/file.dll", result.ElementAt(0).Path.FullPath);
        }
        public void Should_Return_Nearest_Compatible_Framework_If_An_Exact_Match_Is_Not_Possible()
        {
            // Given
            var fixture = new NuGetV2ContentResolverFixture(".NETFramework,Version=v4.5.2");
            fixture.CreateCLRAssembly("/Working/lib/net45/file.dll");
            fixture.CreateCLRAssembly("/Working/lib/net451/file.dll");
            fixture.CreateCLRAssembly("/Working/lib/net461/file.dll");
            fixture.CreateCLRAssembly("/Working/lib/netstandard1.5/file.dll");

            // When
            var result = fixture.GetFiles();

            // Then
            Assert.Equal(1, result.Count);
            Assert.Equal("/Working/lib/net451/file.dll", result.ElementAt(0).Path.FullPath);
        }
        public void Should_Return_Exact_Framework_If_Possible()
        {
            // Given
            var fixture = new NuGetV2ContentResolverFixture(".NETFramework,Version=v4.5");

            fixture.FileSystem.CreateFile("/Working/lib/net45/file.dll");
            fixture.FileSystem.CreateFile("/Working/lib/net451/file.dll");
            fixture.FileSystem.CreateFile("/Working/lib/net452/file.dll");
            fixture.FileSystem.CreateFile("/Working/lib/net461/file.dll");
            fixture.FileSystem.CreateFile("/Working/lib/netstandard1.5/file.dll");
            fixture.FileSystem.CreateFile("/Working/lib/netstandard1.6/file.dll");

            // When
            var result = fixture.GetFiles();

            // Then
            Assert.Equal(1, result.Count);
            Assert.Equal("/Working/lib/net45/file.dll", result.ElementAt(0).Path.FullPath);
        }