SettingsTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Core SettingsTests

Namespace: DeltaEngine.Tests.Core
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class SettingsTests

The SettingsTests type exposes the following members.

Constructors

  NameDescription
Public methodSettingsTests
Initializes a new instance of the SettingsTests class
Top
Methods

  NameDescription
Public methodChangeAndSaveSettings
Public methodCheckDefaultSettings
Public methodCheckMyDocumentsAppFolder
Public methodEditAndCheckSettings
Public methodInit
Public methodSettingsChangeBeforeClose
Public methodSetValueTwice
Top
Examples

[Test]
public void CheckDefaultSettings()
{
    Settings settings = Settings.Current;
    settings.LoadDefaultSettings();
    Assert.AreEqual(Settings.DefaultResolution, settings.Resolution);
    Assert.AreEqual(false, settings.StartInFullscreen);
    Assert.AreEqual(1.0f, settings.SoundVolume);
    Assert.AreEqual(0.75f, settings.MusicVolume);
    Assert.AreEqual(24, settings.DepthBufferBits);
    Assert.AreEqual(32, settings.ColorBufferBits);
    Assert.AreEqual(0, settings.AntiAliasingSamples);
    Assert.AreEqual(0, settings.LimitFramerate);
    Assert.AreEqual(false, settings.UseVSync);
    Assert.AreEqual(20, settings.UpdatesPerSecond);
    Assert.AreEqual(20, settings.RapidUpdatesPerSecond);
}
[Test]
public void ChangeAndSaveSettings()
{
    Settings settings = Settings.Current;
    settings.PlayerName = ModifiedPlayerName;
    settings.TwoLetterLanguageName = ModifiedTwoLetterLanguageName;
    settings.StartInFullscreen = false;
    Assert.AreEqual(settings.TwoLetterLanguageName, ModifiedTwoLetterLanguageName);
    Assert.AreEqual(ModifiedPlayerName, settings.PlayerName);
    settings.Save();
}
[Test]
public void SetValueTwice()
{
    Settings settings = Settings.Current;
    settings.PlayerName = "Blub";
    settings.PlayerName = ModifiedPlayerName;
    Assert.AreEqual(ModifiedPlayerName, settings.PlayerName);
}
[Test]
public void EditAndCheckSettings()
{
    Settings settings = Settings.Current;
    EditSettings(settings);
    Assert.IsTrue((settings as MockSettings).AreChanged);
    CheckSettings(settings);
}
[Test]
public void SettingsChangeBeforeClose()
{
    MockSettings settings = new MockSettings();
    settings.Change();
    settings.Dispose();
}
[Test]
public void CheckMyDocumentsAppFolder()
{
    string deltaEngineDocumentsFolder = Settings.GetMyDocumentsAppFolder();
    Assert.That(deltaEngineDocumentsFolder,
        Is.StringEnding(@"DeltaEngine\DeltaEngine.Tests"));
}
See Also