Exemplo n.º 1
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();
        }
Exemplo n.º 2
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);
        }