Initial import

This commit is contained in:
mlemanczyk committed 2012-09-24 20:55:07 +02:00
1 parent ea3f8549e4
commit fa6feafba7
133 files changed
+17503 -4

No files matched your search

@@ -0,0 +1,59 @@
using System;
using NUnit.Framework;
using DelphiProjectHandler;
namespace DelphiProjectHandler.Tests
{
[TestFixture]
public class UnitFormReaderClassTests
{
protected void TestGetBinaryFormName(string iTestValue, string iExpected, string iMessage)
{
string vActual = UnitFormReader.GetBinaryFormName(iTestValue);
Assert.AreEqual(iExpected, vActual, iMessage);
}
[Test]
public void GetBinaryFormName()
{
#region (Test values)
string vTestValue1 = @"ÿ TFRMACFTDISCREPANCIES 0É TPF0ñTfrmAcftDiscrepanciesfrmAcftDiscrepanciesLeftî TopiWidth™Height¸ CaptionAircraft DiscrepanciesVisibleOnClose FormClose OnCloseQueryFormCloseQuery";
string vTestValue2 = @"ÿ TFRMAIRCRAFTINFO 02 TPF0TfrmAircraftInfofrmAircraftInfoLeftÖ Top";
string vTestValue3 = @"ÿ TFRMBASESI 0í TPF0ñTfrmBaseSI frmBaseSILeftUTop° CaptionfrmBa";
#endregion
TestGetBinaryFormName(vTestValue1, "frmAcftDiscrepancies", "1");
TestGetBinaryFormName(vTestValue2, "frmAircraftInfo", "2");
TestGetBinaryFormName(vTestValue3, "frmBaseSI", "3");
}
[Test]
[ExpectedException(typeof(Exception))]
public void GetBinaryFormName_FormNameIsLast()
{
string vTestValue = @"ÿ TFRMBASESI 0í TPF0ñTfrmBase";
TestGetBinaryFormName(vTestValue, "", "");
}
[Test]
[ExpectedException(typeof(Exception))]
public void GetBinaryFromName_WithoutMarker()
{
string vTestValue = @"ÿ TFRMACFTDISCREPANCIES 0É ñTfrmAcftDiscrepanciesfrmAcftDiscrepanciesLeftî TopiWidth™Height¸ CaptionAircraft DiscrepanciesVisibleOnClose FormClose OnCloseQueryFormCloseQuery";
TestGetBinaryFormName(vTestValue, "", "");
}
[Test]
[ExpectedException(typeof(Exception))]
public void GetBinaryFormName_WithoutFormName()
{
string vTestValue = @"ÿ TFRMACFTDISCREPANCIES 0É TPF0ñ";
TestGetBinaryFormName(vTestValue, "", "");
}
}
}