-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTestSettings.cs
30 lines (27 loc) · 1.27 KB
/
TestSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Quokka.Settings;
using static System.Windows.SystemParameters;
namespace Tests {
/**
* <summary>
* Testing for Quokka settings, i.e., if they apply correctly, are parsed correctly, etc..
* </summary>
*/
[TestClass]
public class TestSettings {
/**
* <summary>
* Testing parsing of Screen Dimensions settings,<br />
* i.e., whether settings that can have screen dimensions values in them, are read and evaluated correctly.
* </summary>
*/
[TestMethod]
public void TestScreenDimensionsParsing() {
string[] possibleSettingValues = { "PrimaryScreenHeight/3", "PrimaryScreenHeight/ 2", "PrimaryScreenWidth / 3",
"PrimaryScreenHeight", "PrimaryScreenWidth", "PrimaryScreenHeight*4", "PrimaryScreenHeight-56", "PrimaryScreenHeight+20"};
double[] correspondingValues = { ( PrimaryScreenHeight / 3 ), ( PrimaryScreenHeight / 2 ), ( PrimaryScreenWidth / 3 ), ( PrimaryScreenHeight ), ( PrimaryScreenWidth ), ( PrimaryScreenHeight * 4 ), ( PrimaryScreenHeight - 56 ), ( PrimaryScreenHeight + 20 ) };
for (int index = 0; index < possibleSettingValues.Length; index++) {
Assert.AreEqual(SettingParsers.parseScreenDimensionsSetting(possibleSettingValues[index]), correspondingValues[index]);
}
}
}
}