public void TestDoubleActivation()
    {
        var terminalServiceMock = new Mock <ITerminalService>();

        terminalServiceMock
        .Setup(m => m.GetTerminalSettings())
        .Returns(new TerminalSettingsStateModel())
        .Verifiable();

        var viewModel = new TerminalSettingsViewModel(terminalServiceMock.Object);

        viewModel.Activate();
        viewModel.Activate();

        terminalServiceMock.Verify(m => m.GetTerminalSettings(), Times.Once);
    }
    public void TestSaveChanges()
    {
        var terminalServiceMock = new Mock <ITerminalService>();

        terminalServiceMock
        .Setup(m => m.GetTerminalSettings())
        .Returns(new TerminalSettingsStateModel
        {
            Command   = DefaultCommand,
            Arguments = DefaultArguments
        });
        terminalServiceMock
        .Setup(m => m.SetTerminalSettings(It.Is <TerminalSettingsStateModel>(ts =>
                                                                             ts.Command == NewCommand && ts.Arguments == NewArguments)))
        .Verifiable();

        var viewModel = new TerminalSettingsViewModel(terminalServiceMock.Object);

        viewModel.Activate();
        viewModel.TerminalCommandText      = NewCommand;
        viewModel.TerminalCommandArguments = NewArguments;

        Assert.True(viewModel.IsChanged);
        viewModel.SaveChanges();

        terminalServiceMock
        .Verify(m => m.SetTerminalSettings(It.Is <TerminalSettingsStateModel>(ts =>
                                                                              ts.Command == NewCommand && ts.Arguments == NewArguments)), Times.Once);
    }
    public void TestActivation()
    {
        var terminalServiceMock = new Mock <ITerminalService>();

        terminalServiceMock
        .Setup(m => m.GetTerminalSettings())
        .Returns(new TerminalSettingsStateModel
        {
            Command   = DefaultCommand,
            Arguments = DefaultArguments
        });

        var viewModel = new TerminalSettingsViewModel(terminalServiceMock.Object);

        viewModel.Activate();

        Assert.False(viewModel.IsChanged);
        Assert.Equal(DefaultCommand, viewModel.TerminalCommandText);
        Assert.Equal(DefaultArguments, viewModel.TerminalCommandArguments);
    }