Esempio n. 1
0
    public void Aliases()
    {
        var path = AllFiles.GetPathFor("jpeg");

        Assert.True(AllFiles.IsEmptyFile(path));

        Assert.Contains("jpeg", AllFiles.ImageExtensions);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
    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));
    }
Esempio n. 5
0
    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));
    }