/*!
 * Copyright 2014 Digital Services, University of Cambridge Licensed
 * under the Educational Community 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://opensource.org/licenses/ECL-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.
 */

require(['gh.core', 'gh.api.tests', 'sinon'], function(gh, testAPI, sinon) {
    module('Orgunit API');

    QUnit.test('init', function(assert) {
        assert.ok(true);
    });

    // Test the getOrgUnits functionality

    // Test the getOrgUnitsByApp functionality

    // Test the getOrgUnit functionality

    // Test the getOrgUnitSeries functionality

    // Test the getOrgUnitCalendar functionality

    // Test the getOrgUnitCalendarIcal functionality

    // Test the getOrgUnitCalendarRss functionality

    // Test the getOrgUnitUpcoming functionality

    // Test the createOrgUnit functionality

    // Test the createOrgUnitByApp functionality

    // Test the updateOrgUnit functionality

    // Test the addOrgUnitSeries functionality

    // Test the addOrgUnitEvents functionality

    // Test the deleteOrgUnitSeries functionality

    // Test the deleteOrgUnitEvents functionality

    // Test the deleteOrgUnit functionality

    // Test the subscribeOrgUnit functionality

    testAPI.init();
});

@@ -842,32 +842,2172 @@
 ts functionality
+%0A    QUnit.asyncTest('getOrgUnits', function(assert) %7B%0A        expect(7);%0A%0A        // Verify that an error is thrown when no callback was provided%0A        assert.throws(function() %7B%0A            gh.api.orgunitAPI.getOrgUnits();%0A        %7D, 'Verify that an error is thrown when no callback was provided');%0A%0A        // Verify that an error is thrown when an invalid callback was provided%0A        assert.throws(function() %7B%0A            gh.api.orgunitAPI.getOrgUnits(1, null, null, null, 'not_a_callback');%0A        %7D, 'Verify that an error is thrown when an invalid callback was provided');%0A%0A        // Verify that an error is thrown when no appId was provided%0A        gh.api.orgunitAPI.getOrgUnits(null, null, null, null, function(err, data) %7B%0A            assert.ok(err, 'Verify that an error is thrown when no app id was provided');%0A%0A            // Verify that an error is thrown when an invalid appId was provided%0A            gh.api.orgunitAPI.getOrgUnits('invalid_appid', null, null, null, function(err, data) %7B%0A                assert.ok(err, 'Verify that an error is thrown when an invalid app id was provided');%0A%0A                // Verify that an error is thrown when no parentId was provided%0A                gh.api.orgunitAPI.getOrgUnits(1, null, 'invalid_parentid', null, function(err, data) %7B%0A                    assert.ok(err, 'Verify that an error is thrown when an invalid parent id was provided');%0A%0A                    // Verify that an error is thrown when an invalid type was provided%0A                    gh.api.orgunitAPI.getOrgUnits(1, null, 1, 123, function(err, data) %7B%0A                        assert.ok(err, 'Verify that an error is thrown when an invalid type was provided');%0A%0A                        // Verify that organisational units can be successfully retrieved%0A                        gh.api.orgunitAPI.getOrgUnits(1, false, null, null, function(err, data) %7B%0A                            assert.ok(!err, 'Verify that organistation units can be successfully retrieved');%0A                            QUnit.start();%0A                        %7D);%0A                    %7D);%0A                %7D);%0A            %7D);%0A        %7D);%0A    %7D);
 %0A%0A    // Test th

Add qunit test for getting organisational units