blob: 2814829d54d3bb2704551d970c8f34ab252f548c [file] [log] [blame]
<?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_XDateField" 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.
'
'*************************************************************************
Sub RunTest()
'*************************************************************************
' INTERFACE:
' com.sun.star.awt.XDateField
'*************************************************************************
On Error Goto ErrHndl
Dim bOK As Boolean
Test.StartMethod("setDate()")
bOK = true
oObj.setDate(5087)
Test.StartMethod("getDate()")
bOK = bOK AND (oObj.getDate() = 5087)
Test.MethodTested("setDate()", bOK)
Test.MethodTested("getDate()", bOK)
Test.StartMethod("setMin()")
bOK = true
oObj.setMin(4978)
Test.StartMethod("getMin()")
bOK = bOK AND (oObj.getMin() = 4978)
Test.MethodTested("setMin()", bOK)
Test.MethodTested("getMin()", bOK)
Test.StartMethod("setMax()")
bOK = true
oObj.setMax(27856)
Test.StartMethod("getMax()")
bOK = bOK AND (oObj.getMax() = 27856)
Test.MethodTested("setMax()", bOK)
Test.MethodTested("getMax()", bOK)
Test.StartMethod("setFirst()")
bOK = true
oObj.setFirst(5118)
Test.StartMethod("getFirst()")
bOK = bOK AND (oObj.getfirst() = 5118)
Test.MethodTested("setFirst()", bOK)
Test.MethodTested("getFirst()", bOK)
Test.StartMethod("setLast()")
bOK = true
oObj.setLast(23450)
Test.StartMethod("getLast()")
bOK = bOK AND (oObj.getLast() = 23450)
Test.MethodTested("setLast()", bOK)
Test.MethodTested("getLast()", bOK)
Test.StartMethod("setLongFormat()")
bOK = true
oObj.setLongFormat(true)
Test.StartMethod("isLongFormat()")
bOK = bOK AND oObj.isLongFormat()
oObj.setLongFormat(false)
bOK = bOK AND NOT oObj.isLongFormat()
Test.MethodTested("setLongFormat()", bOK)
Test.MethodTested("isLongFormat()", bOK)
Test.StartMethod("isEmpty()")
bOK = true
oObj.setDate(6321)
bOK = bOK AND NOT oObj.isEmpty()
Test.StartMethod("setEmpty()")
oObj.setEmpty()
Test.MethodTested("setEmpty()", bOK)
Test.MethodTested("isEmpty()", bOK)
Test.StartMethod("setStrictFormat()")
bOK = true
oObj.setStrictFormat(true)
Test.StartMethod("isStrictFormat()")
bOK = bOK AND oObj.isStrictFormat()
oObj.setStrictFormat(false)
bOK = bOK AND NOT oObj.isStrictFormat()
Test.MethodTested("setStrictFormat()", bOK)
Test.MethodTested("isStrictFormat()", bOK)
Exit Sub
ErrHndl:
Test.Exception()
bOK = false
resume next
End Sub
</script:module>