Added additional unittest to verify that using a different filehash and blockhash works

This commit is contained in:
Kenneth Skovhede
2016-03-30 20:33:15 +02:00
parent fcff385c35
commit 8d0a42e33d
+43 -1
View File
@@ -18,6 +18,7 @@ using System;
using NUnit.Framework;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace Duplicati.UnitTest
{
@@ -60,7 +61,48 @@ namespace Duplicati.UnitTest
RunCommands(12345, 1024 * 1024 * 10);
}
private void RunCommands(int blocksize, int basedatasize = 0)
[Test]
public void RunMD5()
{
PrepareSourceData();
RunCommands(1024 * 10, modifyOptions: opts => {
opts["block-hash-algorithm"] = "MD5";
opts["file-hash-algorithm"] = "MD5";
});
}
[Test]
public void RunSHA384()
{
PrepareSourceData();
RunCommands(1024 * 10, modifyOptions: opts => {
opts["block-hash-algorithm"] = "SHA384";
opts["file-hash-algorithm"] = "SHA384";
});
}
[Test]
public void RunMixedBlockFile_1()
{
PrepareSourceData();
RunCommands(1024 * 10, modifyOptions: opts => {
opts["block-hash-algorithm"] = "MD5";
opts["file-hash-algorithm"] = "SHA1";
});
}
[Test]
public void RunMixedBlockFile_2()
{
PrepareSourceData();
RunCommands(1024 * 10, modifyOptions: opts => {
opts["block-hash-algorithm"] = "MD5";
opts["file-hash-algorithm"] = "SHA256";
});
}
private void RunCommands(int blocksize, int basedatasize = 0, Action<Dictionary<string, string>> modifyOptions = null)
{
var testopts = TestOptions;
testopts["verbose"] = "true";