Check if test file exists before proceeding with test.

This commit is contained in:
2021-03-05 16:36:51 +00:00
parent a2804e4283
commit b5a6420ff7
6 changed files with 111 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using Aaru.Core;
@@ -30,7 +31,16 @@ namespace Aaru.Tests.Filesystems
{
foreach(FileSystemTest test in Tests)
{
string testFile = test.TestFile;
string testFile = test.TestFile;
bool exists = File.Exists(testFile);
Assert.True(exists, $"{testFile} not found");
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
// It arrives here...
if(!exists)
continue;
var filtersList = new FiltersList();
IFilter inputFilter = filtersList.GetFilter(testFile);
@@ -97,7 +107,16 @@ namespace Aaru.Tests.Filesystems
{
foreach(FileSystemTest test in Tests)
{
string testFile = test.TestFile;
string testFile = test.TestFile;
bool exists = File.Exists(testFile);
Assert.True(exists, $"{testFile} not found");
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
// It arrives here...
if(!exists)
continue;
var filtersList = new FiltersList();
IFilter inputFilter = filtersList.GetFilter(testFile);
@@ -129,6 +148,14 @@ namespace Aaru.Tests.Filesystems
bool found = false;
var partition = new Partition();
bool exists = File.Exists(testFile);
Assert.True(exists, $"{testFile} not found");
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
// It arrives here...
if(!exists)
continue;
var filtersList = new FiltersList();
IFilter inputFilter = filtersList.GetFilter(testFile);