"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
const ts_jest_1 = require("@golevelup/ts-jest");
const SetConfigurationCommandHandler_1 = require("./SetConfigurationCommandHandler");
const SetConfigurationCommand_1 = require("./SetConfigurationCommand");
const NetworkFixture_1 = require("../../../../../../__tests__/fixtures/network/NetworkFixture");
describe("SetConfigurationCommandHandler", () => {
    let handler;
    let command;
    const networkServiceMock = (0, ts_jest_1.createMock)();
    beforeEach(() => {
        handler = new SetConfigurationCommandHandler_1.SetConfigurationCommandHandler(networkServiceMock);
        command = NetworkFixture_1.SetConfigurationCommandFixture.create();
    });
    afterEach(() => {
        jest.resetAllMocks();
    });
    describe("execute", () => {
        it("should successfully set configuration", async () => {
            const result = await handler.execute(command);
            expect(result).toBeInstanceOf(SetConfigurationCommand_1.SetConfigurationCommandResponse);
            expect(networkServiceMock.configuration.factoryAddress).toBe(command.factoryAddress);
            expect(networkServiceMock.configuration.resolverAddress).toBe(command.resolverAddress);
            expect(result.factoryAddress).toEqual(command.factoryAddress);
            expect(result.resolverAddress).toEqual(command.resolverAddress);
        });
    });
});
