コード例 #1
0
        public async Task Remove_Folder_With_ChildItems()
        {
            await _query.AddRangeAsync(new List <FileIndexItem>
            {
                new FileIndexItem("/Folder_With_ChildItems")
                {
                    IsDirectory = true
                },
                new FileIndexItem("/Folder_With_ChildItems/test.jpg"),
                new FileIndexItem("/Folder_With_ChildItems/test2.jpg"),
            });

            var result = await new SyncRemove(_appSettings, _query,
                                              new FakeMemoryCache(), new FakeIWebLogger()).Remove("/Folder_With_ChildItems");

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(FileIndexItem.ExifStatus.NotFoundNotInIndex, result[0].Status);
            Assert.AreEqual(FileIndexItem.ExifStatus.NotFoundNotInIndex, result[1].Status);
            Assert.AreEqual(FileIndexItem.ExifStatus.NotFoundNotInIndex, result[2].Status);
            Assert.AreEqual("/Folder_With_ChildItems", result[0].FilePath);
            Assert.AreEqual("/Folder_With_ChildItems/test.jpg", result[1].FilePath);
            Assert.AreEqual("/Folder_With_ChildItems/test2.jpg", result[2].FilePath);
        }