
fitbook.CalculateDiscountMoney Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitlibrary Show documentation
Show all versions of fitlibrary Show documentation
FitLibrary provides general-purpose fixtures (and runners) for storytests with Fit and FitNesse.
The newest version!
package fitbook;
import fitbook.money.Money;
/*
* @author Rick Mugridge on Jan 3, 2005
*
* Copyright (c) 2004 Rick Mugridge, University of Auckland, NZ
* Released under the terms of the GNU General Public License version 2 or later.
*
*/
/**
*
*/
public class CalculateDiscountMoney extends fit.ColumnFixture {
public Money amount;
public Money discount() {
if (amount.greaterThanEqual(new Money(1000*100)))
return amount.times(0.05);
return new Money(0);
}
@SuppressWarnings("unchecked")
@Override
public Object parse(String s, Class type) throws Exception {
if (type == Money.class)
return Money.parse(s);
return super.parse(s,type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy