本文整理汇总了C#中System.Logger.log方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.log方法的具体用法?C# Logger.log怎么用?C# Logger.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Logger
的用法示例。
在下文中一共展示了Logger.log方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testEventTiming
// throws InterruptedException
public virtual void testEventTiming()
{
Logger l = new Logger();
l.log(new Event(null,null));
Thread.Sleep(100);
l.log(new Event(null,null));
Assertion.AssertTrue(l.getElapsedTime() >= 0);
}
示例2: testTopDownUntil
// throws VisitFailure
public virtual void testTopDownUntil()
{
IVisitor stopAt = new SucceedAtNodes(n1, n2);
Logger expected = new Logger();
expected.log(new Event(stopAt, n0));
expected.log(new Event(stopAt, n1));
expected.log(new Event(stopAt, n2));
IVisitable nodeReturned =
DoWhileSuccess.TopDownUntil(logVisitor(stopAt)).visit(n0);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n0, nodeReturned);
}
示例3: testSucceedAtSomeNode
// throws VisitFailure
public virtual void testSucceedAtSomeNode()
{
IVisitor v = new FailAtNodes(n1,n2);
(logVisitor(v)).visit(n0);
Logger expected = new Logger();
expected.log(new Event(v,n0));
Assertion.AssertEquals(expected,logger);
}
示例4: testTrue
// throws VisitFailure
public virtual void testTrue()
{
Logger expected = new Logger();
expected.log( new Event( idTrue, n0 ) );
IVisitable nodeReturned = new IfThenElse( new Identity(), logVisitor(idTrue), logVisitor(idFalse)).visit(n0);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n0, nodeReturned);
}
示例5: testFailAtSomeNodes
// throws VisitFailure
public virtual void testFailAtSomeNodes()
{
ArrayList nodes = new ArrayList();
nodes.Add(n0);
nodes.Add(n1);
nodes.Add(n11);
IVisitor v = new FailAtNodes(nodes);
new Not((logVisitor(v))).visit(n0);
new Not((logVisitor(v))).visit(n1);
(logVisitor(v)).visit(n2);
new Not((logVisitor(v))).visit(n11);
(logVisitor(v)).visit(n12);
Logger expected = new Logger();
expected.log(new Event(v,n0));
expected.log(new Event(v,n1));
expected.log(new Event(v,n2));
expected.log(new Event(v,n11));
expected.log(new Event(v,n12));
Assertion.AssertEquals(expected,logger);
}
示例6: testDoWhileSuccess
// throws VisitFailure
public virtual void testDoWhileSuccess()
{
IVisitor condition = new FailAtNodes(n1, n2);
IVisitor action = new Identity();
Logger expected = new Logger();
expected.log(new Event(condition, n0));
expected.log(new Event(action, n0));
expected.log(new Event(condition, n1));
expected.log(new Event(condition, n2));
IVisitable nodeReturned =
new DoWhileSuccess(
logVisitor(condition),
logVisitor(action)).visit(
n0);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n0, nodeReturned);
}
示例7: testTopDownUntilAtBorder
// throws VisitFailure
public virtual void testTopDownUntilAtBorder()
{
IVisitor stopAt = new SucceedAtNodes(n1, n2);
Logger expected = new Logger();
IVisitor borderAction = new Identity();
expected.log(new Event(stopAt, n0));
expected.log(new Event(stopAt, n1));
expected.log(new Event(borderAction, n1));
expected.log(new Event(stopAt, n2));
expected.log(new Event(borderAction, n2));
IVisitable nodeReturned =
new TopDownUntil(logVisitor(stopAt),
logVisitor(borderAction)
).visit(n0);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n0, nodeReturned);
}
示例8: testFailAtSomeNode
// throws VisitFailure
public virtual void testFailAtSomeNode()
{
IVisitor v = new FailAtNodes(n0,n1);
try
{
(logVisitor(v)).visit(n0);
Assertion.Fail("VisitFailure should have occured");
}
catch (VisitFailure)
{
Logger expected = new Logger();
expected.log(new Event(v,n0));
Assertion.AssertEquals(expected,logger);
}
}
示例9: testTrueFailingThen
// throws VisitFailure
public virtual void testTrueFailingThen()
{
Fail failingThen = new Fail();
Logger expected = new Logger();
expected.log( new Event( failingThen, n0 ) );
try
{
nodeReturned = new IfThenElse( new Identity(), logVisitor(failingThen), logVisitor(idFalse)).visit(n0);
Assertion.Fail();
}
catch(VisitFailure)
{
Assertion.AssertEquals("trace", expected, logger);
Assertion.AssertNull("returned node", nodeReturned);
}
}
示例10: testStopDownUp
// throws jjtraveler.VisitFailure
public virtual void testStopDownUp()
{
Identity downId = new Identity();
Identity upId = new Identity();
Identity stopId = new Identity();
Logger expected = new Logger();
expected.log( new Event(downId, n4) );
expected.log( new Event(stopId, n4) );
expected.log( new Event(upId, n4) );
IVisitor visitor = new DownUp(
logVisitor(downId), logVisitor(stopId), logVisitor(upId) );
IVisitable nodeReturned = visitor.visit(n4);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n4, nodeReturned);
}
示例11: testSequence
// throws VisitFailure
public virtual void testSequence()
{
Identity id1 = new Identity();
Identity id2 = new Identity();
Logger expected = new Logger();
expected.log( new Event(id1, n0) );
expected.log( new Event(id2, n0) );
Sequence ls = new Sequence( logVisitor(id1), logVisitor(id2) );
IVisitable nodeReturned = ls.visit(n0);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(nodeReturned, n0);
}
示例12: testNonStopDownUp
// throws jjtraveler.VisitFailure
public virtual void testNonStopDownUp()
{
Identity downId = new Identity();
Identity upId = new Identity();
Fail stop = new Fail();
Logger expected = new Logger();
expected.log( new Event(downId, n3) );
expected.log( new Event(downId, n0) );
expected.log( new Event(upId, n0) );
expected.log( new Event(downId, n1) );
expected.log( new Event(upId, n1) );
expected.log( new Event(upId, n3) );
IVisitor visitor = new DownUp(
logVisitor(downId), stop, logVisitor(upId) );
IVisitable nodeReturned = visitor.visit(n3);
Assertion.AssertEquals(expected, logger);
Assertion.AssertEquals(n3, nodeReturned);
}