Пример #1
0
    public bool PosTest2()
    {
        bool retVal = true;

        // Add your scenario description here
        TestLibrary.TestFramework.BeginScenario("PosTest2: Verify method GetFormat when arg is not a type of NumberFormatInfo .");

        try
        {
            NumberFormatInfo nfi        = new NumberFormatInfo();
            Type             formatType = typeof(object);

            if (nfi.GetFormat(formatType) != null)
            {
                TestLibrary.TestFramework.LogError("002.1", "Failed to instance a NumberFormatInfo type .");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002.2", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
Пример #2
0
    public bool PosTest2()
    {
        bool retVal = true;

        // Add your scenario description here
        TestLibrary.TestFramework.BeginScenario("PosTest2: Verify method GetFormat when arg is not a type of NumberFormatInfo .");

        try
        {
            NumberFormatInfo nfi = new NumberFormatInfo();
            Type formatType = typeof(object);

            if (nfi.GetFormat(formatType) != null)
            {
                TestLibrary.TestFramework.LogError("002.1", "Failed to instance a NumberFormatInfo type .");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002.2", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
Пример #3
0
    public bool PosTest1()
    {
        bool retVal = true;

        // Add your scenario description here
        TestLibrary.TestFramework.BeginScenario("PosTest1: Verify method GetFormat when arg is a type of NumberFormatInfo .");

        try
        {
            NumberFormatInfo nfi        = new NumberFormatInfo();
            Type             formatType = typeof(NumberFormatInfo);
            object           obj        = nfi.GetFormat(formatType);

            bool testVerify = obj is NumberFormatInfo;

            if (testVerify != true)
            {
                TestLibrary.TestFramework.LogError("001.1", "Method GetFormat .");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.2", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
Пример #4
0
    public bool PosTest1()
    {
        bool retVal = true;

        // Add your scenario description here
        TestLibrary.TestFramework.BeginScenario("PosTest1: Verify method GetFormat when arg is a type of NumberFormatInfo .");

        try
        {
            NumberFormatInfo nfi = new NumberFormatInfo();
            Type formatType = typeof(NumberFormatInfo);
            object obj = nfi.GetFormat(formatType);

            bool testVerify = obj is NumberFormatInfo;

            if (testVerify != true)
            {
                TestLibrary.TestFramework.LogError("001.1", "Method GetFormat .");
                retVal = false;
            }
    

        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.2", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
        public void TestArgNotNumberFormatInfo()
        {
            NumberFormatInfo nfi        = new NumberFormatInfo();
            Type             formatType = typeof(object);

            Assert.Null(nfi.GetFormat(formatType));
        }
        public void TestArgNumberFormatInfo()
        {
            NumberFormatInfo nfi        = new NumberFormatInfo();
            Type             formatType = typeof(NumberFormatInfo);
            object           obj        = nfi.GetFormat(formatType);
            bool             testVerify = obj is NumberFormatInfo;

            Assert.True(testVerify);
        }
        public void GetFormat_InvalidType()
        {
            NumberFormatInfo format = new NumberFormatInfo();

            Assert.Null(format.GetFormat(typeof(object)));
        }
        public void GetFormat_NumberFormatInfo()
        {
            NumberFormatInfo format = new NumberFormatInfo();

            Assert.Same(format, format.GetFormat(typeof(NumberFormatInfo)));
        }
Пример #9
0
 public void GetFormat_InvalidType()
 {
     NumberFormatInfo format = new NumberFormatInfo();
     Assert.Null(format.GetFormat(typeof(object)));
 }
Пример #10
0
 public void GetFormat_NumberFormatInfo()
 {
     NumberFormatInfo format = new NumberFormatInfo();
     Assert.Same(format, format.GetFormat(typeof(NumberFormatInfo)));
 }