Ejemplo n.º 1
0
 public Packager(PackageFileLocator packageFileLocator, PackageMetadataLocator metaDataLocator, PackageConstructor constructor, ILog log)
 {
     _packageFileLocator = packageFileLocator;
     _metaDataLocator = metaDataLocator;
     _constructor = constructor;
     _log = log;
 }
        public void SetUp()
        {
            _rootDir = "c:\\package-source-dir";
            _fs = new Mock<IFileSystem>();

            _filesOnDisk = new Dictionary<string, string[]>
                {
                    {_rootDir + "\\sub-1", new[] {_rootDir + "\\sub-1\\one.txt", _rootDir + "\\sub-1\\two.txt"}},
                    {_rootDir + "\\sub-2", new[] {_rootDir + "\\sub-2\\three.txt", _rootDir + "\\sub-2\\four.txt"}}
                };

            var di = new StubDirectoryInfo(_rootDir, _filesOnDisk);
            _fs.Setup(x => x.DirectoryInfo).Returns(new DiFactoryStub(di));

            _pfl = new PackageFileLocator(_fs.Object, new Mock<ILog>().Object);
        }