Example #1
0
        public async Task ApplyOrGenerateUpdatedFileHash_Should_Update_WhenNotNull()
        {
            var detailView = new DetailView
            {
                FileIndexItem = new FileIndexItem("/test.jpg")
            };

            var readMeta = new ReadMetaSubPathStorage(
                new FakeSelectorStorage(_iStorageFake), _appSettings,
                _memoryCache);
            var service = new MetaUpdateService(_query, _exifTool,
                                                new FakeSelectorStorage(_iStorageFake), new FakeMetaPreflight(),
                                                new FakeIWebLogger(), readMeta);

            await service.ApplyOrGenerateUpdatedFileHash(new List <string>(), detailView.FileIndexItem);

            Assert.IsNotNull(detailView.FileIndexItem.FileHash);
        }
Example #2
0
        public async Task Update_Exception_MissingInList()
        {
            var changedFileIndexItemName = new Dictionary <string, List <string> >();
            var fileIndexResultList      = new List <FileIndexItem>
            {
                new FileIndexItem("/test.jpg")
                {
                    Status = FileIndexItem.ExifStatus.Ok
                }
            };

            var readMeta = new ReadMetaSubPathStorage(
                new FakeSelectorStorage(_iStorageFake), _appSettings,
                _memoryCache);
            var service = new MetaUpdateService(_query, _exifTool,
                                                new FakeSelectorStorage(_iStorageFake), new FakeMetaPreflight(),
                                                new FakeIWebLogger(), readMeta);

            await service.UpdateAsync(changedFileIndexItemName, fileIndexResultList,
                                      null, false, false, 0);

            // expect exception
        }