/** @overview nodeunit test case. */
var testResource = require('../../../test_resource'),
    mockReq = testResource.requireMockModule('mock_modules/mock_req'),
    mockRes = testResource.requireMockModule('mock_modules/mock_res'),
    mockContext = testResource.requireMockModule('mock_modules/mock_context'),
    defineClusterDomainMiddleware = require('../../../../serverside/middleware/define_cluster_domain_middleware.js');

exports.setUp = function (done) {
    done();
};

exports.tearDown = function (done) {
    done();
};


exports['Create new cluster domain middleware.'] = function (test) {
    var middleware = defineClusterDomainMiddleware(mockContext({
        SERVER_CRASH_DELAY: 100
    }));
    var req = mockReq({}),
        res = mockRes({});
    middleware(req, res, function (err) {
        test.ifError(err);
        test.done();
    });
};