Beispiel #1
0
        private bool TestIncrement(int _TestStepNo)
        {
            //Test increment
            PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestIncrement->Log-> Testing IncrementOrDecrementItemValue...");

            //Previous value ("Test_Attr_Key_2", 11115.0f),
            bool bLocalFailure = !SelectedDBService.IncrementOrDecrementItemValue(
                TableName,
                Key, new BPrimitiveType("test_1"),
                out double NewValue,
                "Test_Attr_Key_2",
                11120.0f,
                true,
                (string Message) =>
            {
                Console.WriteLine("Step " + _TestStepNo + "->" + "TestIncrement->Error-> " + Message);
                bLocalFailure = true;
            });

            if (bLocalFailure)
            {
                PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestIncrement->Error-> IncrementOrDecrementItemValue failed.");
                return(false);
            }

            if (NewValue == -5.0f)
            {
                PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestIncrement->Log-> IncrementOrDecrementItemValue succeed. Returned: " + NewValue);
                return(true);
            }
            PrintAction?.Invoke("Step " + _TestStepNo + "->" + "TestIncrement->Log-> IncrementOrDecrementItemValue failed. Returned: " + NewValue);
            return(false);
        }