define([
    'bitbucket/internal/model/conflict'
], function(
    Conflict
) {

    'use strict';

    module('model-conflict');

    test('getConflictMessage', function() {

        function makeConflict(ourChange, theirChange) {
            return new Conflict({
                ourChange: ourChange && {
                    type : ourChange
                },
                theirChange: theirChange && {
                    type : theirChange
                }
            });
        }

        strictEqual((makeConflict("ADD",      "ADD")).getConflictMessage(), "bitbucket.web.pullrequest.diff.conflict.title.add.add" , "Correct message is returned when both states are valid and they have a match in the matrix");
        strictEqual((makeConflict("ADD",      "DELETE")).getConflictMessage(), "" , "Empty string returned when changes have valid states that don't have a match in the matrix");
        strictEqual((makeConflict("FOO",      "BAR")).getConflictMessage(), "" , "Empty string returned when changes have incorrect states");
        strictEqual((makeConflict(new Date(), {})).getConflictMessage(), "", "Empty string returned when changes have invalid states");
        strictEqual((makeConflict("ADD",      undefined)).getConflictMessage(), "" , "Empty string returned if conflict is missing 'our' change");
        strictEqual((makeConflict(undefined,  "ADD")).getConflictMessage(), "" , "Empty string returned if conflict is missing 'their' change");
        strictEqual((new Conflict()).getConflictMessage(), "" , "Empty string returned if conflict is missing both changes");
    });

});