define([
    'bitbucket/internal/model/commit-range',
    'bitbucket/internal/model/pull-request',
    'bitbucket/internal/model/revision'
], function(
    CommitRange,
    PullRequest,
    Revision
) {
    'use strict';
    module('model-commit-range');

    test('getId', function() {
        strictEqual((new CommitRange({
            pullRequest : new PullRequest({ id : '123' })
        })).getId(),'123',"Returns pull-request id when commit-range contains a pull-request");
        strictEqual((new CommitRange({
            untilRevision : new Revision({ id : '123' }),
            sinceRevision : new Revision({ id : '456' })
        })).getId(),'123_456',"Returns both hashes when commit-range contains 2 revisions");
        strictEqual((new CommitRange({
            untilRevision : new Revision({ id : '123' })
        })).getId(),'123_ROOT',"Returns `until` hash and `root` when commit-range contains only `until` revision");
        throws(function() { new CommitRange(); }, "Commit-range throws error if neither pull-request or revisions supplied");
    });

});