public void GetPackageTargetFrameworkReturnsNullIfPackageIdIsNotPresent()
        {
            // Arrange
            var repository = new Mock <MockPackageRepository>()
            {
                CallBase = true
            }.As <ISharedPackageRepository>();
            var packageA = PackageUtility.CreatePackage("A");

            repository.Object.AddPackage(packageA);
            var fileSystem = new MockFileSystem();

            fileSystem.AddFile("packages.config", @"<?xml version=""1.0"" encoding=""utf-8""?>
<packages>
  <package id=""A"" version=""1.0"" />
</packages>");
            var referenceRepository = new PackageReferenceRepository(fileSystem, projectName: null, sourceRepository: repository.Object);

            // Act
            var targetFramework = referenceRepository.GetPackageTargetFramework("B");

            // Assert
            Assert.Null(targetFramework);
        }
        public void GetPackageTargetFrameworkReturnsCorrectValue()
        {
            // Arrange
            var repository = new Mock <MockPackageRepository>()
            {
                CallBase = true
            }.As <ISharedPackageRepository>();
            var packageA = PackageUtility.CreatePackage("A");

            repository.Object.AddPackage(packageA);
            var fileSystem = new MockFileSystem();

            fileSystem.AddFile("packages.config", @"<?xml version=""1.0"" encoding=""utf-8""?>
<packages>
  <package id=""A"" version=""1.0"" targetFramework=""winrt45"" />
</packages>");
            var referenceRepository = new PackageReferenceRepository(fileSystem, projectName: null, sourceRepository: repository.Object);

            // Act
            var targetFramework = referenceRepository.GetPackageTargetFramework("A");

            // Assert
            Assert.Equal(new FrameworkName(".NETCore, Version=4.5"), targetFramework);
        }
        public void GetPackageTargetFrameworkReturnsNullIfPackageIdIsNotPresent()
        {
            // Arrange
            var repository = new Mock<MockPackageRepository>() { CallBase = true }.As<ISharedPackageRepository>();
            var packageA = PackageUtility.CreatePackage("A");
            repository.Object.AddPackage(packageA);
            var fileSystem = new MockFileSystem();
            fileSystem.AddFile("packages.config", @"<?xml version=""1.0"" encoding=""utf-8""?>
<packages>
  <package id=""A"" version=""1.0"" />
</packages>");
            var referenceRepository = new PackageReferenceRepository(fileSystem, repository.Object);

            // Act
            var targetFramework = referenceRepository.GetPackageTargetFramework("B");

            // Assert
            Assert.Null(targetFramework);
        }
        public void GetPackageTargetFrameworkReturnsCorrectValue()
        {
            // Arrange
            var repository = new Mock<MockPackageRepository>() { CallBase = true }.As<ISharedPackageRepository>();
            var packageA = PackageUtility.CreatePackage("A");
            repository.Object.AddPackage(packageA);
            var fileSystem = new MockFileSystem();
            fileSystem.AddFile("packages.config", @"<?xml version=""1.0"" encoding=""utf-8""?>
<packages>
  <package id=""A"" version=""1.0"" targetFramework=""winrt45"" />
</packages>");
            var referenceRepository = new PackageReferenceRepository(fileSystem, repository.Object);

            // Act
            var targetFramework = referenceRepository.GetPackageTargetFramework("A");

            // Assert
            Assert.Equal(new FrameworkName(".NETCore, Version=4.5"), targetFramework);
        }