@Test
  public void testCreateDefaultSettings() {
    // given
    File settingsXML = new File(Paths.Setting.settingsXMLPath);
    settingsXML.deleteOnExit();

    File installationData = new File(Paths.Setting.installationDataXMLPath);
    installationData.deleteOnExit();

    EnvironmentContext environmentContext = new EnvironmentContext();
    environmentContext.setSettingsXMLPath(Paths.Setting.settingsXMLPath);
    environmentContext.setInstallationDataXMLPath(Paths.Setting.installationDataXMLPath);

    // when
    EnvironmentData environmentData =
        new EnvironmentDataManager(environmentContext).createDefaultSettings();
    ClientSettings clientSettings = environmentData.getClientSettings();
    List<ProgramSettings> programsSettings =
        new ArrayList<ProgramSettings>(environmentData.getProgramsSettings());

    // then
    assertThat(clientSettings)
        .as("createEnvironmentData() should create client's settings")
        .isNotNull();
    assertThat(clientSettings.getPathToClientDirectory())
        .as("createEnvironmentData() should create client's directory")
        .isNotNull()
        .isEqualTo(environmentContext.getDefaultPathToClientDirectory());
    assertThat(clientSettings.getPathToClient())
        .as("createEnvironmentData() should create client's executable")
        .isNotNull()
        .isEqualTo(environmentContext.getDefaultPathToClient());
    assertThat(clientSettings.getPathToInstaller())
        .as("createEnvironmentData() should create installer's path")
        .isNotNull()
        .isEqualTo(environmentContext.getDefaultPathToInstaller());

    assertThat(programsSettings)
        .as("createEnvironmentData() should not create any program's settings")
        .isNotNull()
        .isEmpty();
  }
  @Test
  public void testSetEnvironmentData() throws ClientEnvironmentException, IOException {
    // given
    File settingsXML = new File(Paths.Setting.settingsXMLPath);
    settingsXML.deleteOnExit();

    File installationData = new File(Paths.Setting.installationDataXMLPath);
    installationData.deleteOnExit();

    EnvironmentContext environmentContext = new EnvironmentContext();
    environmentContext.setSettingsXMLPath(Paths.Setting.settingsXMLPath);
    environmentContext.setInstallationDataXMLPath(Paths.Setting.installationDataXMLPath);

    EnvironmentDataManager environmentDataService = new EnvironmentDataManager(environmentContext);

    // when
    environmentDataService.setEnvironmentData(environmentData());
    EnvironmentData savedEnvironmentData = environmentDataService.getEnvironmentData();
    ClientSettings savedClientSettings = savedEnvironmentData.getClientSettings();
    List<ProgramSettings> savedProgramsSettings =
        new ArrayList<ProgramSettings>(savedEnvironmentData.getProgramsSettings());

    // then
    assertThat(savedClientSettings)
        .as("setEnvironmentData(EnvironmentData) should save client's settings")
        .isNotNull();
    assertThat(savedClientSettings.getPathToClientDirectory())
        .as("setEnvironmentData(EnvironmentData) should save client's directory")
        .isNotNull()
        .isEqualTo(Paths.Library.clientDir);
    assertThat(savedClientSettings.getPathToClient())
        .as("setEnvironmentData(EnvironmentData) should save client's executable")
        .isNotNull()
        .isEqualTo(Paths.Library.clientPath);
    assertThat(savedClientSettings.getPathToInstaller())
        .as("setEnvironmentData(EnvironmentData) should save installer's path")
        .isNotNull()
        .isEqualTo(Paths.Library.installerPath);
    ;

    assertThat(savedProgramsSettings)
        .as("setEnvironmentData(EnvironmentData) should save installation data")
        .isNotNull()
        .hasSize(2);
    assertThat(savedProgramsSettings.get(0).getProgramName())
        .as("setEnvironmentData(EnvironmentData) should save program's name")
        .isNotNull()
        .isEqualTo(Values.ProgramSettings.programName);
    assertThat(savedProgramsSettings.get(0).getPathToProgramDirectory())
        .as("setEnvironmentData(EnvironmentData) should save program's directory")
        .isNotNull()
        .isEqualTo(Paths.Installations.Program.programDir);
    assertThat(savedProgramsSettings.get(0).getPathToProgram())
        .as("setEnvironmentData(EnvironmentData) should save path to program")
        .isNotNull()
        .isEqualTo(Paths.Installations.Program.programPath);
    assertThat(savedProgramsSettings.get(0).getServerAddress())
        .as("setEnvironmentData(EnvironmentData) should save server's address")
        .isNotNull()
        .isEqualTo(Values.ProgramSettings.serverAddress);
    assertThat(savedProgramsSettings.get(0).isDevelopmentVersion())
        .as("setEnvironmentData(EnvironmentData) should save development version")
        .isTrue();
  }