Create rudimentary view models, default settings.

This commit is contained in:
Daniel Kraus
2015-07-31 17:19:49 +02:00
parent a725246f27
commit 12cd58180f
21 changed files with 937 additions and 43 deletions

View File

@ -49,12 +49,34 @@ namespace Tests.Controller
Settings s = new Settings();
string testName = "test";
s.Name = testName;
sr.Settings.Add(s);
sr.SettingsList.Add(s);
sr.Store();
sr = null;
sr = SettingsRepository.Load();
Assert.AreEqual(1, sr.Settings.Count);
Assert.AreEqual(testName, sr.Settings[0].Name);
Assert.AreEqual(1, sr.SettingsList.Count);
Assert.AreEqual(testName, sr.SettingsList[0].Name);
}
[Test]
public void CreateDefaultSettings()
{
SettingsRepository sr = new SettingsRepository();
sr.SettingsList.Add(new Settings("test1", null));
sr.SettingsList.Add(new Settings("test2", null));
sr.SettingsList.Add(new Settings("test3", null));
sr.ResetDefault();
// Assert that there are now only the 2 default settings
Assert.AreEqual(2, sr.SettingsList.Count);
Assert.AreEqual(
zaaReloaded2.Properties.Settings.Default.SettingsNameWard,
sr.SettingsList[0].Name,
"Settings for ward expected as #1 (index 0) in list");
Assert.AreEqual(
zaaReloaded2.Properties.Settings.Default.SettingsNameClinic,
sr.SettingsList[1].Name,
"Settings for outpatient clinic expected as #2 (index 1) in list");
}
}
}