public void OddKeyInt() { var storage = new PreferenceStorage (); var expectedInt = 4096; storage.SetInt (Key2, expectedInt); var i = storage.GetInt (Key); Assert.AreEqual (PreferenceStorage.Defaults.Int, i); var i2 = storage.GetInt (Key2); Assert.AreEqual (expectedInt, i2); }
public void OddKeyString() { var storage = new PreferenceStorage (); var expectString = "Hans im Glück!"; storage.SetString (Key2, expectString); var s = storage.GetString (Key); Assert.AreEqual (PreferenceStorage.Defaults.String, s); var s2 = storage.GetString (Key2); Assert.AreEqual (expectString, s2); }
public void OddKeyFloat() { var storage = new PreferenceStorage (); var expectedFloat = 3.1415f; storage.SetFloat (Key2, expectedFloat); var f = storage.GetFloat (Key); Assert.AreEqual (PreferenceStorage.Defaults.Float, f); var f2 = storage.GetFloat (Key2); Assert.AreEqual (expectedFloat, f2); }
public void OddKeyBool() { var storage = new PreferenceStorage (); var expectedBool = true; storage.SetBool (Key2, expectedBool); var b = storage.GetBool (Key); Assert.AreEqual (PreferenceStorage.Defaults.Bool, b); var b2 = storage.GetBool (Key2); Assert.AreEqual (expectedBool, b2); }
public void SetGetBool() { var storage = new PreferenceStorage (); var expected = true; storage.SetBool (Key, expected); { var actual = storage.GetBool (Key); Assert.AreEqual (expected, actual); } storage.SetBool (Key, expected && false); { var actual = storage.GetBool (Key); Assert.AreEqual (expected && false, actual); } }
public void SetGetString() { var storage = new PreferenceStorage (); var expected = "счастли́вый"; storage.SetString (Key, expected); { var actual = storage.GetString (Key); Assert.AreEqual (expected, actual); } storage.SetString (Key, expected + 1); { var actual = storage.GetString (Key); Assert.AreEqual (expected + 1, actual); } }
public void SetGetInt() { var storage = new PreferenceStorage (); var expected = 133742; storage.SetInt (Key, expected); { var actual = storage.GetInt (Key); Assert.AreEqual (expected, actual); } storage.SetInt (Key, expected + 1); { var actual = storage.GetInt (Key); Assert.AreEqual (expected + 1, actual); } }
public void SetGetFloat() { var storage = new PreferenceStorage (); var expected = ((float)Math.Sqrt (5f) + 1f) / 2f; storage.SetFloat (Key, expected); { var actual = storage.GetFloat (Key); Assert.AreEqual (expected, actual); } storage.SetFloat (Key, expected + 1); { var actual = storage.GetFloat (Key); Assert.AreEqual (expected + 1, actual); } }