Exemple #1
0
            public void ShouldReturnEmptyIfPackagesConfigDoesNotExist()
            {
                _fs.Setup(i => i.FileExists(It.IsAny <string>())).Returns(false);

                var resolver = new PackageAssemblyResolver(_fs.Object, _pc.Object);
                var result   = resolver.GetPackages(@"c:/");

                result.ShouldBeEmpty();
            }
Exemple #2
0
            public void ShouldGetReferencesToPackages()
            {
                _fs.Setup(i => i.FileExists(It.IsAny <string>())).Returns(true);
                _pc.Setup(i => i.FindReferences(It.IsAny <string>())).Returns(new List <IPackageReference> {
                    new PackageReference("id", VersionUtility.ParseFrameworkName("net40"), new Version("3.0"))
                });

                var resolver = new PackageAssemblyResolver(_fs.Object, _pc.Object);
                var result   = resolver.GetPackages(@"c:/");

                _pc.Verify(i => i.FindReferences(It.IsAny <string>()), Times.Once());
                result.Count().ShouldEqual(1);
            }
            public void ShouldReturnEmptyIfPackagesConfigDoesNotExist()
            {
                _fs.Setup(i => i.FileExists(It.IsAny<string>())).Returns(false);

                var resolver = new PackageAssemblyResolver(_fs.Object, _pc.Object, _logger.Object);
                var result = resolver.GetPackages(@"c:/");

                result.ShouldBeEmpty();
            }
            public void ShouldGetReferencesToPackages()
            {
                _fs.Setup(i => i.FileExists(It.IsAny<string>())).Returns(true);
                _pc.Setup(i => i.FindReferences(It.IsAny<string>())).Returns(new List<IPackageReference> { new PackageReference("id", VersionUtility.ParseFrameworkName("net40"), new Version("3.0")) });

                var resolver = new PackageAssemblyResolver(_fs.Object, _pc.Object, _logger.Object);
                var result = resolver.GetPackages(@"c:/");

                _pc.Verify(i => i.FindReferences(It.IsAny<string>()), Times.Once());
                result.Count().ShouldEqual(1);
            }