define([
    'bitbucket/internal/model/file-change',
    'bitbucket/internal/model/file-change-types'
], function(
    FileChange,
    ChangeTypes
) {

    'use strict';

    module('model-file-change');

    test('ChangeTypes when creating FileChange fromDiff', function() {

        var addedDiff = {
            hunks: [{
                sourceLine: 0,
                sourceSpan: 1,
                destinationLine: 1,
                destinationSpan: 1
            }]
        };

        var removedDiff = {
            hunks: [{
                sourceLine: 1,
                sourceSpan: 1,
                destinationLine: 0,
                destinationSpan: 0
            }]
        };

        var modifiedDiff = {
            hunks: [{
                sourceLine: 1,
                sourceSpan: 1,
                destinationLine: 2,
                destinationSpan: 1
            }]
        };

        equal( FileChange.fromDiff(addedDiff).getType(), ChangeTypes.ADD, 'Added diff has correct type');
        equal( FileChange.fromDiff(removedDiff).getType(), ChangeTypes.DELETE, 'Removed diff has correct type');
        equal( FileChange.fromDiff(modifiedDiff).getType(), ChangeTypes.MODIFY, 'Modified diff has correct type');

    });


});