public virtual void TestError_CcTruncatedOld()
{
NGit.Patch.Patch p = ParseTestPatchFile();
NUnit.Framework.Assert.AreEqual(1, p.GetFiles().Count);
NUnit.Framework.Assert.AreEqual(3, p.GetErrors().Count);
{
FormatError e = p.GetErrors()[0];
NUnit.Framework.Assert.AreEqual(FormatError.Severity.ERROR, e.GetSeverity());
NUnit.Framework.Assert.AreEqual(MessageFormat.Format(JGitText.Get().truncatedHunkLinesMissingForAncestor
, Sharpen.Extensions.ValueOf(1), Sharpen.Extensions.ValueOf(1)), e.GetMessage());
NUnit.Framework.Assert.AreEqual(346, e.GetOffset());
NUnit.Framework.Assert.IsTrue(e.GetLineText().StartsWith("@@@ -55,12 -163,13 +163,15 @@@ public "
));
}
{
FormatError e = p.GetErrors()[1];
NUnit.Framework.Assert.AreEqual(FormatError.Severity.ERROR, e.GetSeverity());
NUnit.Framework.Assert.AreEqual(MessageFormat.Format(JGitText.Get().truncatedHunkLinesMissingForAncestor
, Sharpen.Extensions.ValueOf(2), Sharpen.Extensions.ValueOf(2)), e.GetMessage());
NUnit.Framework.Assert.AreEqual(346, e.GetOffset());
NUnit.Framework.Assert.IsTrue(e.GetLineText().StartsWith("@@@ -55,12 -163,13 +163,15 @@@ public "
));
}
{
FormatError e = p.GetErrors()[2];
NUnit.Framework.Assert.AreEqual(FormatError.Severity.ERROR, e.GetSeverity());
NUnit.Framework.Assert.AreEqual("Truncated hunk, at least 3 new lines is missing"
, e.GetMessage());
NUnit.Framework.Assert.AreEqual(346, e.GetOffset());
NUnit.Framework.Assert.IsTrue(e.GetLineText().StartsWith("@@@ -55,12 -163,13 +163,15 @@@ public "
));
}
}