public void Aliases() { var path = AllFiles.GetPathFor("jpeg"); Assert.True(AllFiles.IsEmptyFile(path)); Assert.Contains("jpeg", AllFiles.ImageExtensions); }
public void IsEmptyFile() { #region IsEmptyFile var path = AllFiles.GetPathFor("jpg"); Assert.True(AllFiles.IsEmptyFile(path)); var temp = Path.GetTempFileName(); Assert.False(AllFiles.IsEmptyFile(temp)); #endregion var path2 = AllFiles.GetPathFor(".jpg"); Assert.True(AllFiles.IsEmptyFile(path2)); File.Delete(temp); }
public static async Task <CompareResult> DoCompare(VerifySettings settings, FilePair file) { if (!File.Exists(file.Verified)) { return(CompareResult.MissingVerified); } if (AllFiles.IsEmptyFile(file.Verified)) { return(CompareResult.NotEqual); } if (!await FilesEqual(settings, file)) { return(CompareResult.NotEqual); } return(CompareResult.Equal); }
public static async Task <EqualityResult> DoCompare(VerifySettings settings, FilePair file, bool previousTextHasFailed) { if (!File.Exists(file.Verified)) { return(Equality.MissingVerified); } if (AllFiles.IsEmptyFile(file.Verified)) { return(Equality.NotEqual); } var result = await FilesEqual(settings, file, previousTextHasFailed); if (result.IsEqual) { return(Equality.Equal); } return(new(Equality.NotEqual, result.Message)); }
public static async Task <EqualityResult> DoCompare(VerifySettings settings, FilePair file) { if (!File.Exists(file.Verified)) { return(Equality.MissingVerified); } if (AllFiles.IsEmptyFile(file.Verified)) { return(Equality.NotEqual); } var compareResult = await FilesEqual(settings, file); if (compareResult.IsEqual) { return(Equality.Equal); } return(new EqualityResult(Equality.NotEqual, compareResult.Message)); }