01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.purap.rules;
17:
18: import static org.kuali.test.fixtures.UserNameFixture.KHUNTLEY;
19:
20: import org.kuali.module.purap.document.RequisitionDocument;
21: import org.kuali.module.purap.fixtures.AmountsLimitsFixture;
22: import org.kuali.test.ConfigureContext;
23:
24: @ConfigureContext(session=KHUNTLEY)
25: public class RequisitionDocumentRuleTest extends PurapRuleTestBase {
26:
27: RequisitionDocumentRule rule;
28: RequisitionDocument req;
29:
30: protected void setUp() throws Exception {
31: super .setUp();
32: req = new RequisitionDocument();
33: rule = new RequisitionDocumentRule();
34: }
35:
36: protected void tearDown() throws Exception {
37: rule = null;
38: req = null;
39: super .tearDown();
40: }
41:
42: public void testValidateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit_ZeroAmountSmallLimit() {
43: req = AmountsLimitsFixture.ZERO_AMOUNT_SMALL_LIMIT
44: .populateRequisition();
45: assertTrue(rule
46: .validateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit(req));
47: }
48:
49: public void testValidateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit_SmallAmountSmallLimit() {
50: req = AmountsLimitsFixture.SMALL_AMOUNT_SMALL_LIMIT
51: .populateRequisition();
52: assertTrue(rule
53: .validateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit(req));
54: }
55:
56: public void testValidateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit_LargeAmountSmallLimit() {
57: req = AmountsLimitsFixture.LARGE_AMOUNT_SMALL_LIMIT
58: .populateRequisition();
59: assertFalse(rule
60: .validateTotalDollarAmountIsLessThanPurchaseOrderTotalLimit(req));
61: }
62: }
|