|
Lift Framework example source code file (CurrencyZoneSpec.scala)
The Lift Framework CurrencyZoneSpec.scala source code/* * Copyright 2007-2011 WorldWide Conferencing, LLC * * Licensed 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. */ package net.liftweb package util import org.specs.Specification /** * Systems under specification for CurrencyZone. */ object CurrencyZoneSpec extends Specification("CurrencyZone Specification") { "Australian money" should { "not equal to other money" in { val auBoolean = AU(4.42) != US(4.42) auBoolean mustEqual true } "be not equal to a different amount of its own money" in { val auBoolean = AU(4.48) == AU(4.481) auBoolean mustEqual false } "be equal to the same amount of its own money" in { val auBoolean = AU(4.42) == AU(4.42) auBoolean mustEqual true } "be comparable not gt" in { val auBoolean = AU(4.42) > AU(4.420000) auBoolean mustEqual false } "be creatable" in { AU(20.1).get mustMatch "20.10" } "be addable" in { val au = AU(20.68) + AU(3.08) au.get mustMatch "23.76" } "be subtractable" in { val au = AU(23.76) - AU(3.08) au.get mustMatch "20.68" } "be mutipliable" in { val au = AU(20.68) * 3 au.get mustMatch "62.04" } "be divisable" in { val au = AU(20.68) / AU(3) au.get mustMatch "6.89" } "be comparable gt" in { val auBoolean = AU(20.68) > AU(3) auBoolean mustEqual true } "be comparable lt" in { val auBoolean = AU(3.439) < AU(3.44) auBoolean mustEqual true } "be comparable lt or eq" in { val auBoolean = AU(20.68) <= AU(20.68) auBoolean mustEqual true } } } Other Lift Framework examples (source code examples)Here is a short list of links related to this Lift Framework CurrencyZoneSpec.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.