Exemple #1
0
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: Call NextDouble to check the Sample works");

        try
        {
            TestRandom random = new TestRandom(-55);
            double value = random.NextDouble();

            if ((value < 0.0) || (value >= 1.0))
            {
                TestLibrary.TestFramework.LogError("001.1", "NextDouble returns a value less than 0 or equal to 1.0");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] value = " + value);
                retVal = false;
            }

            value = random.CallSample();

            if ((value < 0.0) || (value >= 1.0))
            {
                TestLibrary.TestFramework.LogError("001.2", "NextDouble returns a value less than 0 or equal to 1.0");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] value = " + value);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.0", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
Exemple #2
0
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: Call NextDouble to check the Sample works");

        try
        {
            TestRandom random = new TestRandom(-55);
            double     value  = random.NextDouble();

            if ((value < 0.0) || (value >= 1.0))
            {
                TestLibrary.TestFramework.LogError("001.1", "NextDouble returns a value less than 0 or equal to 1.0");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] value = " + value);
                retVal = false;
            }

            value = random.CallSample();

            if ((value < 0.0) || (value >= 1.0))
            {
                TestLibrary.TestFramework.LogError("001.2", "NextDouble returns a value less than 0 or equal to 1.0");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] value = " + value);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.0", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }