Ejemplo n.º 1
0
    public bool PosTest7()
    {
        bool   retVal = true;
        string ActualResult;
        object ObjA;
        object ObjB;
        object ObjC;

        TestLibrary.TestFramework.BeginScenario("PosTest7: Concat null and an object of datetime and one space");
        try
        {
            ObjA         = null;
            ObjB         = new DateTime();
            ObjC         = " ";
            ActualResult = string.Concat(ObjA, ObjB, ObjC);
            if (ActualResult != ObjB.ToString() + ObjC.ToString())
            {
                TestLibrary.TestFramework.LogError("013", "Concat null and an object of datetime and one space ExpectResult is equel" + ObjB.ToString() + ObjC.ToString() + ",ActualResult is (" + ActualResult + ")");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("014", "Unexpected exception" + e);
            retVal = false;
        }
        return(retVal);
    }
Ejemplo n.º 2
0
    public bool PosTest4()
    {
        bool   retVal = true;
        string ActualResult;
        object ObjA;
        object ObjB;
        object ObjC;

        TestLibrary.TestFramework.BeginScenario("PosTest4: Concat three special strings");
        try
        {
            ObjA         = new string('\t', 2);
            ObjB         = "\n";
            ObjC         = "\t";
            ActualResult = string.Concat(ObjA, ObjB, ObjC);
            if (ActualResult != ObjA.ToString() + ObjB.ToString() + ObjC.ToString())
            {
                TestLibrary.TestFramework.LogError("007", "Concat three special strings ExpectResult is" + ObjB.ToString() + ObjA.ToString() + ObjC.ToString() + " ,ActualResult is (" + ActualResult + ")");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("008", "Unexpected exception" + e);
            retVal = false;
        }
        return(retVal);
    }
Ejemplo n.º 3
0
    public bool PosTest5()
    {
        bool   retVal = true;
        string ActualResult;
        object ObjA;
        object ObjB;
        object ObjC;

        TestLibrary.TestFramework.BeginScenario("PosTest5:Concat three numbers of less than 0");
        try
        {
            ObjA         = -123;
            ObjB         = -123;
            ObjC         = -123;
            ActualResult = string.Concat(ObjA, ObjB, ObjC);
            if (ActualResult != ObjA.ToString() + ObjB.ToString() + ObjC.ToString())
            {
                TestLibrary.TestFramework.LogError("009", "Concat three numbers of less than 0 ExpectResult is equel" + ObjA.ToString() + ObjB.ToString() + " ,ActualResult is (" + ActualResult + ")");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("010", "Unexpected exception" + e);
            retVal = false;
        }
        return(retVal);
    }
Ejemplo n.º 4
0
    public bool PosTest3()
    {
        bool   retVal = true;
        string ActualResult;
        object ObjA;
        object ObjB;
        object ObjC;

        TestLibrary.TestFramework.BeginScenario("PosTest3:Concat two null objects and a number of less than 0");
        try
        {
            ObjA         = null;
            ObjB         = null;
            ObjC         = -12314124;
            ActualResult = string.Concat(ObjA, ObjB, ObjC);
            if (ActualResult != ObjC.ToString())
            {
                TestLibrary.TestFramework.LogError("005", "Concat two null objects and a number of less than 0 ExpectResult is equel" + ObjC.ToString() + ",ActualResult is (" + ActualResult + ")");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpected exception" + e);
            retVal = false;
        }
        return(retVal);
    }