public void ToString_EndingConditionOnly()
        {
            string vExpected =
                "    unit_name,\n" +
                "  {$end}";

            UnitItem vUnit = new UnitItem("unit_name");
            vUnit.EndingConditions = "{$end}";
            string vActual = vUnit.ToString("  ", ",", false);

            Assert.AreEqual(vExpected, vActual);
        }
 public void ToString_WithPath_WithoutBacklash()
 {
     UnitItem vUnit = new UnitItem("unit_name", @"c:\temp", true, "");
     string vExpected = "unit_name in 'c:\\temp\\unit_name.pas'";
     string vActual = vUnit.ToString("", "", false);
     Assert.AreEqual(vExpected, vActual);
 }
        protected void DoTestToString_WithConditions(bool iAddConditions, string iSeparator, bool iSeparatorLast, string iExpected)
        {
            UnitItem vUnit = new UnitItem("unit_name", "unit_path", true, "");
            if (iAddConditions)
            {
                vUnit.StartingConditions = "{$condition1}";
                vUnit.EndingConditions = "{$condition2}";
            }

            string vActual = vUnit.ToString("  ", iSeparator, iSeparatorLast);

            Assert.AreEqual(iExpected, vActual);
        }
 public void ToString_WithoutPath()
 {
     UnitItem vUnit = new UnitItem("unit_name");
     Assert.AreEqual("unit_name", vUnit.ToString("", "", false));
 }
        public void ToString_WithForm()
        {
            string vExpected =
                "  unit_name {unit_name};";

            UnitItem vUnit = new UnitItem("unit_name", "", false, "unit_name");
            string vActual = vUnit.ToString("  ", ";", true);
            Assert.AreEqual(vExpected, vActual);
        }
        public void ToString_StartingConditionOnly()
        {
            string vExpected =
                "  {$begin}\n" +
                "    unit_name;";

            UnitItem vUnit = new UnitItem("unit_name");
            vUnit.StartingConditions = "{$begin}";
            string vActual = vUnit.ToString("  ", ";", false);

            Assert.AreEqual(vExpected, vActual);
        }
 public void ToString_RelativePath_WithoutBackslash()
 {
     UnitItem vUnit = new UnitItem("unit_name", @"..\..", true, "");
     string vExpected = "unit_name in '..\\..\\unit_name.pas'";
     string vActual = vUnit.ToString("", "", false);
     Assert.AreEqual(vExpected, vActual);
 }
 public void ToString_RelativePath_BlankPath()
 {
     UnitItem vUnit = new UnitItem("unit_name", "", true, "");
     string vExpected = "unit_name in 'unit_name.pas'";
     string vActual = vUnit.ToString("", "", false);
     Assert.AreEqual(vExpected, vActual);
 }