Пример #1
0
        public void SetUp()
        {
            _folder = new AutoKillFolder("TestBinariesCache", true);
            Directory.CreateDirectory(_folder.Path);
            _path = Path.Combine(_folder.Path, "test");

            _data  = new MockBinaryDataCache();
            _cache = new BinariesCache(_data);
            _cache.Create(_path);

            var random = new Random();

            _bytes = new byte[BinaryDataStorageClass.MaxBufferSize * 2];
            random.NextBytes(_bytes);
        }
Пример #2
0
        public void SetUp()
        {
            _frame           = new UnitTestDispatcher();
            _tags            = new MockTagsCache();
            _paths           = new MockPathsCache(_tags);
            _data            = new MockBinaryDataCache();
            _binaries        = new MockBinariesCache(_data);
            _errorHandler    = new MockErrorHandler();
            _fileValidator   = new MockFileValidator();
            _eventAggregator = new UnitTestEventAggregator();

            CreateData();

            _view = new LibraryView(_tags, _paths, _binaries, _frame.Dispatcher, null, _errorHandler, _fileValidator, _eventAggregator);
            _view.AttachDisplay(new MockDisplay());
            _frame.RunDispatcher();
        }
Пример #3
0
        public void SetUp()
        {
            _dataCache = new MockBinaryDataCache();
            _binaries  = new MockBinariesCache(_dataCache);

            var random = new Random();

            _bytes = new byte[BinaryDataStorageClass.MaxBufferSize * 2];
            random.NextBytes(_bytes);

            _items = Enumerable.Range(0, 40).Select(i => new BinaryStorageClass {
                Id = Guid.NewGuid()
            }).ToList();

            foreach (var bsc in _items)
            {
                _binaries.Add(bsc, _bytes);
            }

            _cache = new LoadedBinaryCache(CacheCapacity, _binaries);
        }