public void TestConstructorCriteria() { Bean bean = new Bean(); bean.Id = 2; bean.Name = "123"; bool hasParameterId = false; bool hasParameterName = false; object beaIdValue = null; object beaNameValue = null; FilterCriteria criteria = new FilterCriteria(bean); foreach (FilterCriteriaParam parameter in criteria.Parameters) { if ("BEA_ID".Equals(parameter.ColumnName)) { hasParameterId = true; beaIdValue = parameter.Value; } else if ("BEA_NAME".Equals(parameter.ColumnName)) { hasParameterName = true; beaNameValue = parameter.Value; } else { Assert.Fail(); } } Assert.IsTrue(hasParameterId); Assert.IsTrue(hasParameterName); Assert.AreEqual(bean.Id, beaIdValue); Assert.AreEqual(bean.Name, beaNameValue); }
public void TestLoadTooMayRows() { SqlTestStore <Bean> store = new SqlTestStore <Bean>("name"); Bean bean = store.Load(null, 2); }
public void TestLoadZeroRow() { SqlTestStore <Bean> store = new SqlTestStore <Bean>("name"); Bean bean = store.Load(null, 0); }