Skip to content

Commit

Permalink
tests passing for Delta.Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Oct 2, 2016
1 parent a86aa28 commit 56d4266
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Tests/Test.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;

namespace Tests
{
Expand Down Expand Up @@ -29,8 +30,20 @@ public void TestCreateAndApply()
[Test ()]
public void TestApplyTruncatedDelta ()
{
}
byte[] origin = System.IO.File.ReadAllBytes ("../../data/1/origin");
byte[] delta = System.IO.File.ReadAllBytes ("../../data/1/delta");

// Apply successfully
Assert.DoesNotThrow (() => Fossil.Delta.Apply (origin, delta));

// Let's corrupt our delta
Stack<byte> deltaBytes = new Stack<byte> (delta);
deltaBytes.Pop ();
byte[] corruptedDelta = deltaBytes.ToArray ();

// Apply should throw exception
Assert.Throws<Exception> (() => Fossil.Delta.Apply(origin, corruptedDelta));
}

}
}
Expand Down

0 comments on commit 56d4266

Please sign in to comment.