Ejemplo n.º 1
0
        private void CreateData()
        {
            var random = new Random();

            foreach (var path in new[]
            {
                null,
                new[] { "FolderA", "FolderA1" },
                new[] { "FolderB", "FolderB1", "FolderB2" },
                new[] { "FolderC", "FolderC1", "FolderC2", "FolderC3" },
                new[] { "FolderD", "FolderD1" },
                new[] { "FolderD", "FolderD1", "FolderD2", "FolderD3", "FolderD4" },
            })
            {
                foreach (var binName in new[] { "Bin1", "Bin2", "Bin3" })
                {
                    var data = new byte[100];
                    random.NextBytes(data);
                    var nameTag            = _tags.AddOrGet(binName);
                    var binaryStorageClass = new BinaryStorageClass {
                        Id = Guid.NewGuid(), NameTag = nameTag
                    };
                    if (path != null)
                    {
                        binaryStorageClass.PathId = _paths.AddOrGet(path);
                    }
                    _binaries.Add(binaryStorageClass, data);
                }
            }
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            _folder = new AutoKillFolder("TestPathsCache", true);
            Directory.CreateDirectory(_folder.Path);
            _path = Path.Combine(_folder.Path, "test");

            _tags  = new MockTagsCache();
            _cache = new PathsCache(_tags);
            _cache.Create(_path);

            _tags.AddOrGet("A");
        }