Ejemplo n.º 1
0
    public void AssertSettingsUpdated()
    {
        SettingsStorage storage = new SettingsStorage(PATH_TEST);

        SettingsModel settingsModel = new SettingsModel(5, 5, 10, 500);

        // Update the settings in file
        storage.updateSettings(settingsModel);

        settingsModel.maxFutureDistance = 1000;
        settingsModel.shortRadius       = 1200;
        settingsModel.longRadius        = 1233;
        settingsModel.speed             = 400;

        // Update the settings in file
        storage.updateSettings(settingsModel);

        // Read settings in file
        SettingsModel settingsSaved = storage.readSettings();

        Assert.That(settingsModel.maxFutureDistance == settingsSaved.maxFutureDistance);
        Assert.That(settingsModel.longRadius == settingsSaved.longRadius);
        Assert.That(settingsModel.shortRadius == settingsSaved.shortRadius);
        Assert.That(settingsModel.speed == settingsSaved.speed);
    }