public void GetAllDPTestsOneExists() { using (LogDatabase db = new LogDatabase(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Testfiles\\TestLog4.plg"), false, null)) { db.Read(); NamedLogRow[] data; Assert.Catch <KeyNotFoundException>(() => data = db.GetAllDP(new[] { new KeyValuePair <string, LogRowType>("Gamma", LogRowType.Point), new KeyValuePair <string, LogRowType>("Delta", LogRowType.Raw) }).ToArray()); } }
public void GetAllDPTests() { using (LogDatabase db = new LogDatabase(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Testfiles\\TestLog4.plg"), false, null)) { db.Read(); var data = db.GetAllDP(new KeyValuePair <string, LogRowType>[] { new KeyValuePair <string, LogRowType>("Alpha", LogRowType.Raw), new KeyValuePair <string, LogRowType>("Delta", LogRowType.Point) }).ToArray(); Assert.AreEqual("Alpha", data[0].Fullname); Assert.AreEqual("False", data[0].GetAsDataRow.Value); Assert.AreEqual("Delta", data[1].Fullname); Assert.AreEqual(0.7, data[1].GetAsDataPoint.Value, 0.1); Assert.AreEqual("Alpha", data[2].Fullname); Assert.AreEqual("True", data[2].GetAsDataRow.Value); Assert.AreEqual("Delta", data[3].Fullname); Assert.AreEqual(0.9, data[3].GetAsDataPoint.Value, 0.1); } }