01: /**********************************************************************************
02: * $URL: $
03: * $Id: $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the"License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: *
21: **********************************************************************************/package org.sakaiproject.tool.assessment.test.integration.helper.ifc;
22:
23: import junit.framework.*;
24: import org.sakaiproject.tool.assessment.integration.helper.ifc.*;
25:
26: public class TestGradebookHelper extends TestCase {
27: private GradebookHelper gradebookHelper = null;
28: private boolean isIntegrated;
29:
30: public TestGradebookHelper(GradebookHelper gradebookHelper,
31: boolean integrated) {
32: this .gradebookHelper = gradebookHelper;
33: this .isIntegrated = integrated;
34: assertNotNull(gradebookHelper);
35: }
36:
37: protected void setUp() throws Exception {
38: super .setUp();
39: }
40:
41: protected void tearDown() throws Exception {
42: gradebookHelper = null;
43: super .tearDown();
44: }
45:
46: public void testGetDefaultGradebookUId() {
47: assertNotNull(gradebookHelper);
48: String actualReturn = gradebookHelper.getDefaultGradebookUId();
49: assertNotNull(actualReturn);
50: String expectedReturn = null;
51: if (isStandalone()) {
52: expectedReturn = "QA_8";
53: }
54: if (this .isIntegrated()) {
55: expectedReturn = "Test Gradebook #1";
56: }
57: assertEquals("return value", expectedReturn, actualReturn);
58: }
59:
60: // in unti test, we can't find some components yet, just test we can hit this.
61: public void testGetGradebookUId() {
62: String actualReturn = gradebookHelper.getGradebookUId();
63: String expectedReturn = null;
64: assertEquals("return value", expectedReturn, actualReturn);
65: }
66:
67: public boolean isIntegrated() {
68: return isIntegrated;
69: }
70:
71: public boolean isStandalone() {
72: return !isIntegrated;
73: }
74:
75: }
|