public void PropertyExistsTest() { var p = new CMSProperties(_database); p.SaveProperty(TestPropName, "doesn't matter"); Assert.IsTrue(p.PropertyExists(TestPropName)); }
public void GetPropertyBoolTestUsingInt0() { var p = new CMSProperties(_database); p.SaveProperty(TestPropName, 0); var b = p.GetProperty(TestPropName, true); Assert.AreEqual(b, false); }
public void GetPropertyTimestampTest() { var p = new CMSProperties(_database); p.SaveProperty(TestPropName, "doesn't matter"); var d = p.GetPropertyTimestamp(TestPropName); Assert.AreNotEqual(d, DateTime.MinValue); }
public void GetPropertyValueListTest() { var p = new CMSProperties(_database); p.SaveProperty(TestPropName, "abc,123,xyz,789"); var l = p.GetPropertyValueList(TestPropName, "1,2"); Assert.AreEqual(l.Count, 4); }
public void FillSingleValueIntegerTest() { var p = new CMSProperties(_database); p.SaveProperty(Test01Name, 42); var i = _database.FillSingleValueInteger($"SELECT Value FROM Properties WHERE Property='{Test01Name}'"); Assert.AreEqual(i, 42); }
public void FillSingleValueBooleanTest() { var p = new CMSProperties(_database); p.SaveProperty(Test01Name, true); var b = _database.FillSingleValueBoolean($"SELECT Value FROM Properties WHERE Property='{Test01Name}'"); Assert.IsTrue(b); }
public void FillDataSetTest() { var p = new CMSProperties(_database); p.SaveProperty(Test01Name, Test01Value); var ds = _database.FillDataSet("SELECT * FROM Properties"); Assert.IsTrue(ds.Tables[0].Rows.Count > 0); }
public void FillSingleValueTest() { var p = new CMSProperties(_database); p.SaveProperty(Test01Name, "String Value"); var s = _database.FillSingleValue($"SELECT Value FROM Properties WHERE Property='{Test01Name}'"); Assert.AreEqual(s, "String Value"); }
public void SavePropertyDateTimeTest() { var p = new CMSProperties(_database); var d1 = DateTime.UtcNow; p.SaveProperty(TestPropName, d1); var d2 = p.GetProperty(TestPropName, DateTime.MinValue); Assert.AreEqual(d1, d2); }
public void SavePropertyTest() { var p = new CMSProperties(_database); var testValue = Guid.NewGuid().ToString(); p.SaveProperty(TestPropName, testValue); var s = p.GetProperty(TestPropName, ""); Assert.AreEqual(s, testValue); }
public void FillSingleValueDateTimeTest() { var p = new CMSProperties(_database); var d1 = DateTime.UtcNow; p.SaveProperty(Test01Name, d1); var d2 = _database.FillSingleValueDateTime($"SELECT Value FROM Properties WHERE Property='{Test01Name}'"); Assert.AreEqual(d1, d2); }
public void DeletePropertyTest() { var p = new CMSProperties(_database); var testValue = Guid.NewGuid().ToString(); p.SaveProperty(TestPropName, testValue); Assert.IsTrue(p.PropertyExists(TestPropName)); p.DeleteProperty(TestPropName); Assert.IsFalse(p.PropertyExists(TestPropName)); }
public void GetPropertyIntTest() { var p = new CMSProperties(_database); Random rnd = new Random(); var i1 = rnd.Next(1, 999); p.SaveProperty(TestPropName, i1); var i2 = p.GetProperty(TestPropName, 0); Assert.AreEqual(i1, i2); }
public void ExistsQueryTest() { var p = new CMSProperties(_database); p.SaveProperty(Test01Name, Test01Value); var b = _database.ExistsQuery("SELECT Property FROM Properties LIMIT 1"); Assert.AreEqual(b, true); b = _database.ExistsQuery($"SELECT Property FROM Properties WHERE Value='{Guid.NewGuid()}' LIMIT 1"); Assert.AreEqual(b, false); }