| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> |
| <script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XCurrencyField" script:language="StarBasic"> |
| |
| |
| '************************************************************************* |
| ' |
| ' Licensed to the Apache Software Foundation (ASF) under one |
| ' or more contributor license agreements. See the NOTICE file |
| ' distributed with this work for additional information |
| ' regarding copyright ownership. The ASF licenses this file |
| ' to you under the Apache License, Version 2.0 (the |
| ' "License"); you may not use this file except in compliance |
| ' with the License. You may obtain a copy of the License at |
| ' |
| ' http://www.apache.org/licenses/LICENSE-2.0 |
| ' |
| ' Unless required by applicable law or agreed to in writing, |
| ' software distributed under the License is distributed on an |
| ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ' KIND, either express or implied. See the License for the |
| ' specific language governing permissions and limitations |
| ' under the License. |
| ' |
| '************************************************************************* |
| |
| |
| |
| |
| |
| ' Be sure that all variables are dimensioned: |
| option explicit |
| |
| |
| |
| Sub RunTest() |
| |
| '************************************************************************* |
| ' INTERFACE: |
| ' com.sun.star.awt.XCurrencyField |
| '************************************************************************* |
| On Error Goto ErrHndl |
| Dim bOK As Boolean |
| |
| Test.StartMethod("getValue()") |
| Dim value As Double |
| value = oObj.getValue() |
| bOK = True |
| Test.MethodTested("getValue()", bOK) |
| |
| Test.StartMethod("setValue()") |
| oObj.setValue(value + 1.1) |
| bOK = oObj.getValue() = (value + 1.1) |
| Test.MethodTested("setValue()", bOK) |
| |
| Test.StartMethod("getMin()") |
| Dim min As Double |
| min = oObj.getMin() |
| bOK = True |
| Test.MethodTested("getMin()", bOK) |
| |
| Test.StartMethod("setMin()") |
| oObj.setMin(min + 1.1) |
| bOK = oObj.getMin() = (min + 1.1) |
| Test.MethodTested("setMin()", bOK) |
| |
| Test.StartMethod("getMax()") |
| Dim max As Double |
| max = oObj.getMax() |
| bOK = True |
| Test.MethodTested("getMax()", bOK) |
| |
| Test.StartMethod("setMax()") |
| oObj.setMax(max + 1.1) |
| bOK = oObj.getMax() = (max + 1.1) |
| Test.MethodTested("setMax()", bOK) |
| |
| Test.StartMethod("getFirst()") |
| Dim first As Double |
| first = oObj.getFirst() |
| bOK = True |
| Test.MethodTested("getFirst()", bOK) |
| |
| Test.StartMethod("setFirst()") |
| oObj.setFirst(first + 1.1) |
| bOK = oObj.getFirst() = first + 1.1 |
| Test.MethodTested("setFirst()", bOK) |
| |
| Test.StartMethod("getLast()") |
| Dim last As Double |
| last = oObj.getLast() |
| bOK = True |
| Test.MethodTested("getLast()", bOK) |
| |
| Test.StartMethod("setLast()") |
| oObj.setLast(last + 1.1) |
| bOK = oObj.getLast() = (last + 1.1) |
| Test.MethodTested("setLast()", bOK) |
| |
| Test.StartMethod("getSpinSize()") |
| Dim spinSize As Double |
| spinSize = oObj.getSpinSize() |
| bOK = True |
| Test.MethodTested("getSpinSize()", bOK) |
| |
| Test.StartMethod("setSpinSize()") |
| oObj.setSpinSize(spinSize + 1.1) |
| bOK = oObj.getSpinSize() = (spinSize + 1.1) |
| Test.MethodTested("setSpinSize()", bOK) |
| |
| Test.StartMethod("getDecimalDigits()") |
| Dim digits As Integer |
| digits = oObj.getDecimalDigits() |
| bOK = True |
| Test.MethodTested("getDecimalDigits()", bOK) |
| |
| Test.StartMethod("setDecimalDigits()") |
| oObj.setDecimalDigits(digits + 1) |
| bOK = oObj.getDecimalDigits() = (digits + 1) |
| Test.MethodTested("setDecimalDigits()", bOK) |
| |
| Test.StartMethod("isStrictFormat()") |
| Dim strict As Boolean |
| strict = oObj.isStrictFormat() |
| bOK = True |
| Test.MethodTested("isStrictFormat()", bOK) |
| |
| Test.StartMethod("setStrictFormat()") |
| oObj.setStrictFormat(Not strict) |
| bOK = oObj.isStrictFormat() <> strict |
| Test.MethodTested("setStrictFormat()", bOK) |
| |
| Exit Sub |
| ErrHndl: |
| Test.Exception() |
| bOK = false |
| resume next |
| End Sub |
| </script:module> |