public void GetPackageFilesOnlyDetectsFilesWithPackageExtension()
        {
            // Arrange
            var mockFileSystem = new MockProjectSystem();
            mockFileSystem.AddFile("foo.nupkg");
            mockFileSystem.AddFile("bar.zip");

            var repository = new LocalPackageRepository(new DefaultPackagePathResolver(mockFileSystem),
                                                        mockFileSystem);

            // Act
            var files = repository.GetPackageFiles().ToList();

            // Assert
            Assert.Equal(1, files.Count);
            Assert.Equal("foo.nupkg", files[0]);
        }
Пример #2
0
        public void GetPackageFilesOnlyDetectsFilesWithPackageExtension()
        {
            // Arrange
            var mockFileSystem = new MockProjectSystem();

            mockFileSystem.AddFile("foo.nupkg");
            mockFileSystem.AddFile("bar.zip");

            var repository = new LocalPackageRepository(new DefaultPackagePathResolver(mockFileSystem),
                                                        mockFileSystem);

            // Act
            var files = repository.GetPackageFiles().ToList();

            // Assert
            Assert.Equal(1, files.Count);
            Assert.Equal("foo.nupkg", files[0]);
        }
        public void GetPackageFilesDetectsFilesInRootOrFirstLevelOfFolders()
        {
            // Arrange
            var mockFileSystem = new MockProjectSystem();
            mockFileSystem.AddFile("P1.nupkg");
            mockFileSystem.AddFile("bar.zip");
            mockFileSystem.AddFile(PathFixUtility.FixPath(@"baz\P2.nupkg"));
            mockFileSystem.AddFile(PathFixUtility.FixPath(@"A\B\P3.nupkg"));
            mockFileSystem.AddFile(PathFixUtility.FixPath(@"A\P4.nupkg"));
            var repository = new LocalPackageRepository(new DefaultPackagePathResolver(mockFileSystem),
                                                        mockFileSystem);

            // Act
            var files = repository.GetPackageFiles().ToList();

            // Assert
            Assert.Equal(3, files.Count);
            Assert.Equal(PathFixUtility.FixPath(@"baz\P2.nupkg"), files[0]);
            Assert.Equal(PathFixUtility.FixPath(@"A\P4.nupkg"), files[1]);
            Assert.Equal("P1.nupkg", files[2]);
        }
Пример #4
0
        public void GetPackageFilesDetectsFilesInRootOrFirstLevelOfFolders()
        {
            // Arrange
            var mockFileSystem = new MockProjectSystem();

            mockFileSystem.AddFile("P1.nupkg");
            mockFileSystem.AddFile("bar.zip");
            mockFileSystem.AddFile(@"baz\P2.nupkg");
            mockFileSystem.AddFile(@"A\B\P3.nupkg");
            mockFileSystem.AddFile(@"A\P4.nupkg");
            var repository = new LocalPackageRepository(new DefaultPackagePathResolver(mockFileSystem),
                                                        mockFileSystem);

            // Act
            var files = repository.GetPackageFiles().ToList();

            // Assert
            Assert.Equal(3, files.Count);
            Assert.Equal(@"baz\P2.nupkg", files[0]);
            Assert.Equal(@"A\P4.nupkg", files[1]);
            Assert.Equal("P1.nupkg", files[2]);
        }