1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XCurrencyField" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8'  Licensed to the Apache Software Foundation (ASF) under one
9'  or more contributor license agreements.  See the NOTICE file
10'  distributed with this work for additional information
11'  regarding copyright ownership.  The ASF licenses this file
12'  to you under the Apache License, Version 2.0 (the
13'  "License"); you may not use this file except in compliance
14'  with the License.  You may obtain a copy of the License at
15'
16'    http://www.apache.org/licenses/LICENSE-2.0
17'
18'  Unless required by applicable law or agreed to in writing,
19'  software distributed under the License is distributed on an
20'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21'  KIND, either express or implied.  See the License for the
22'  specific language governing permissions and limitations
23'  under the License.
24'
25'*************************************************************************
26
27
28
29
30
31' Be sure that all variables are dimensioned:
32option explicit
33
34
35
36Sub RunTest()
37
38'*************************************************************************
39' INTERFACE:
40' com.sun.star.awt.XCurrencyField
41'*************************************************************************
42On Error Goto ErrHndl
43    Dim bOK As Boolean
44
45    Test.StartMethod("getValue()")
46    Dim value As Double
47    value = oObj.getValue()
48    bOK = True
49    Test.MethodTested("getValue()", bOK)
50
51    Test.StartMethod("setValue()")
52    oObj.setValue(value + 1.1)
53    bOK = oObj.getValue() = (value + 1.1)
54    Test.MethodTested("setValue()", bOK)
55
56    Test.StartMethod("getMin()")
57    Dim min As Double
58    min = oObj.getMin()
59    bOK = True
60    Test.MethodTested("getMin()", bOK)
61
62    Test.StartMethod("setMin()")
63    oObj.setMin(min + 1.1)
64    bOK = oObj.getMin() = (min + 1.1)
65    Test.MethodTested("setMin()", bOK)
66
67    Test.StartMethod("getMax()")
68    Dim max As Double
69    max = oObj.getMax()
70    bOK = True
71    Test.MethodTested("getMax()", bOK)
72
73    Test.StartMethod("setMax()")
74    oObj.setMax(max + 1.1)
75    bOK = oObj.getMax() = (max + 1.1)
76    Test.MethodTested("setMax()", bOK)
77
78    Test.StartMethod("getFirst()")
79    Dim first As Double
80    first = oObj.getFirst()
81    bOK = True
82    Test.MethodTested("getFirst()", bOK)
83
84    Test.StartMethod("setFirst()")
85    oObj.setFirst(first + 1.1)
86    bOK = oObj.getFirst() = first + 1.1
87    Test.MethodTested("setFirst()", bOK)
88
89    Test.StartMethod("getLast()")
90    Dim last As Double
91    last = oObj.getLast()
92    bOK = True
93    Test.MethodTested("getLast()", bOK)
94
95    Test.StartMethod("setLast()")
96    oObj.setLast(last + 1.1)
97    bOK = oObj.getLast() = (last + 1.1)
98    Test.MethodTested("setLast()", bOK)
99
100    Test.StartMethod("getSpinSize()")
101    Dim spinSize As Double
102    spinSize = oObj.getSpinSize()
103    bOK = True
104    Test.MethodTested("getSpinSize()", bOK)
105
106    Test.StartMethod("setSpinSize()")
107    oObj.setSpinSize(spinSize + 1.1)
108    bOK = oObj.getSpinSize() = (spinSize + 1.1)
109    Test.MethodTested("setSpinSize()", bOK)
110
111    Test.StartMethod("getDecimalDigits()")
112    Dim digits As Integer
113    digits = oObj.getDecimalDigits()
114    bOK = True
115    Test.MethodTested("getDecimalDigits()", bOK)
116
117    Test.StartMethod("setDecimalDigits()")
118    oObj.setDecimalDigits(digits + 1)
119    bOK = oObj.getDecimalDigits() = (digits + 1)
120    Test.MethodTested("setDecimalDigits()", bOK)
121
122    Test.StartMethod("isStrictFormat()")
123    Dim strict As Boolean
124    strict = oObj.isStrictFormat()
125    bOK = True
126    Test.MethodTested("isStrictFormat()", bOK)
127
128    Test.StartMethod("setStrictFormat()")
129    oObj.setStrictFormat(Not strict)
130    bOK = oObj.isStrictFormat() &lt;&gt; strict
131    Test.MethodTested("setStrictFormat()", bOK)
132
133Exit Sub
134ErrHndl:
135    Test.Exception()
136    bOK = false
137    resume next
138End Sub
139</script:module>
140