/* A P P E N D I T E M T O V I E W */ /*---------------------------------------------------------------------------- * %%Function: AppendItemToView * %%Qualified: AzLog.AzLogView.AppendItemToView * %%Contact: rlittle * * Append a single item to our view -- make sure it matches our filter * ----------------------------------------------------------------------------*/ private void AppendItemToView(int i) { AzLogEntry azle = m_azlm.LogEntry(i); if (m_azlf.FEvaluate(azle)) { m_pliale.Add(i); } }
public static void TestAzLogFilterSingle() { AzLogFilter azlf = new AzLogFilter(); TestAzLogFilterValueMock mock = new TestAzLogFilterValueMock(); mock.m_mpColumnValue = new Dictionary <AzLogEntry.LogColumn, string>(); mock.m_mpColumnValue.Add(AzLogEntry.LogColumn.AppName, "TestValue"); azlf.Add(new AzLogFilterCondition(AzLogFilterValue.ValueType.String, AzLogFilterValue.DataSource.Column, AzLogEntry.LogColumn.AppName, AzLogFilterCondition.CmpOp.Eq, "TestValue")); Assert.AreEqual(true, azlf.FEvaluate(mock)); }
public static void TestAzLogFilterDateRange(string sDttmRow, AzLogFilterCondition.CmpOp cmpop1, String sCmp1, AzLogFilterCondition.CmpOp cmpop2, string sCmp2, bool fExpected) { AzLogFilter azlf = new AzLogFilter(); TestAzLogFilterValueMock mock = new TestAzLogFilterValueMock(); mock.m_dttmRow = DateTime.Parse(sDttmRow); azlf.Add(new AzLogFilterCondition(AzLogFilterValue.ValueType.DateTime, AzLogFilterValue.DataSource.DttmRow, AzLogEntry.LogColumn.Nil, cmpop1, DateTime.Parse(sCmp1))); azlf.Add(new AzLogFilterCondition(AzLogFilterValue.ValueType.DateTime, AzLogFilterValue.DataSource.DttmRow, AzLogEntry.LogColumn.Nil, cmpop2, DateTime.Parse(sCmp2))); azlf.Add(AzLogFilterOperation.OperationType.And); Assert.AreEqual(fExpected, azlf.FEvaluate(mock)); }
public static void TestAzLogFilterSingle() { AzLogFilter azlf = new AzLogFilter(); TestAzLogFilterValueMock mock = new TestAzLogFilterValueMock(); mock.m_mpColumnValue = new Dictionary<AzLogEntry.LogColumn, string>(); mock.m_mpColumnValue.Add(AzLogEntry.LogColumn.AppName, "TestValue"); azlf.Add(new AzLogFilterCondition(AzLogFilterValue.ValueType.String, AzLogFilterValue.DataSource.Column, AzLogEntry.LogColumn.AppName, AzLogFilterCondition.CmpOp.Eq, "TestValue")); Assert.AreEqual(true, azlf.FEvaluate(mock)); }