コード例 #1
0
        public void ShouldContain()
        {
            // Arrange
            string shouldContainFolder = "ShouldGet";
            string inputFolderPath     = Path.Combine(this.inputBasePath, shouldContainFolder);
            string assertFolderPath    = Path.Combine(this.assertBasePath, shouldContainFolder);

            // Act
            using (var storage = new BinaryStorage(new StorageConfiguration()
            {
                WorkingFolder = inputFolderPath
            }))
            {
                Directory.EnumerateFiles(assertFolderPath, "*", SearchOption.AllDirectories)
                .AsParallel().WithDegreeOfParallelism(degreeOfParallelism).ForAll(s =>
                {
                    string fileName = Path.GetFileName(s);
                    if (!storage.Contains(fileName))
                    {
                        Assert.Fail();
                    }
                });
            }
            // Assert
            Assert.IsTrue(true);
        }