Example #1
0
    [Test] public void Name()
    {
        status s;

        s = fail.Via(log && "Test"); o(F.Name(s), "failing");
        s = done.Via(log && "Test"); o(F.Name(s), "done");
        s = cont.Via(log && "Test"); o(F.Name(s), "running");
    }
Example #2
0
    [Test] public void SysTrace_withAction()
    {
        //F.UseLineNumbers = true;
        var z = F.SysTrace("Src/Task.cs", "action", 4);

        o(z, "Task");
        //F.UseLineNumbers = false;
    }
Example #3
0
    [Test] public void MultiLevelCallTree()
    {
        var s = (
            done.Via(log && "B.", "Foo", "Bar") &&
            done.Via(log && "C.", "Foo", "Bar")
            ).Via(log && "A.", "Top", "Level");

        o(F.CallTree(s),
          "* Top.Level (A.)\n  * Foo.Bar (B.)\n  * Foo.Bar (C.)\n");
    }
Example #4
0
    [Test] public void Format()
    {
        t = 0;
        status s = x[5]?[done.Via(log && "Reason")];

        // '?' indicates the decorator doesn't know what it's gating just yet.
        // But we're about to find out hence '-> Test'
        o(F.Status(s), "* <C> [5.0] -> TestCooldown.Format (Reason)");
        s = x[5]?[done.Via(log && "Test")];
        // Since the target returned 'done' we're now on cooldown. The target
        // scope was stored in the previous run, so the '? ->' notation drops.
        o(F.Status(s), "  <C> [5.0] TestCooldown.Format");
    }
Example #5
0
 [Test] public void Symbol()
 {
     o(F.Symbol(fail.Via(log && ")Do")) == ' ');
     o(F.Symbol(cont.Via(log && ")Go")) == '+');
     o(F.Symbol(done.Via(log && ")Up")) == '*');
 }
Example #6
0
    /*
     * [Test] public void StatusWithPromotionPrefix(){
     *  o (F.Status((+cont).due.Via(
     *                         log && "Attack", "A", "B")), "* +A.B (Attack)");
     * }
     *
     * [Test] public void StatusWithDemotionPrefix(){
     *  o (F.Status((-done).undue.Via(
     *                         log && "Attack", "A", "B")), "+ -A.B (Attack)");
     * }
     *
     * [Test] public void StatusWithCondonePrefix(){
     *  o (F.Status((~fail).due.Via(
     *                         log && "Attack", "A", "B")), "* ~A.B (Attack)");
     * }
     *
     * [Test] public void StatusWithMultiplePrefix(){
     *  o (F.Status(+-!~fail.Via(log && "Attack", "A", "B")),
     *                                   "+ +-!~A.B (Attack)" );
     * }
     */

    [Test] public void TraceViaCallerInfo()
    {
        o(F.Status(done.Via()), "* TestStatusFormat.TraceViaCallerInfo");
    }
Example #7
0
 [Test] public void StatusWithInversionPrefix()
 {
     o(F.Status(!done.Via(log && "Attack", "A", "B")), "  !A.B (Attack)");
 }
Example #8
0
 [Test] public void Status()
 {
     o(F.Status(done.Via(log && "Out of range", "NPC", "Attack")),
       "* NPC.Attack (Out of range)");
 }
Example #9
0
    [Test] public void SingleLevelCallTree()
    {
        var s = fail.Via(log && "Out of range", "NPC", "Attack");

        o(F.CallTree(s), "  NPC.Attack (Out of range)\n");
    }
Example #10
0
 [Test] public void Decorator()
 {
     o(F.Decorator(new Cooldown()), "<C>");
 }
Example #11
0
 [SetUp] public void Setup() => F.UseASCII();
Example #12
0
    [Test] public void SysTrace()
    {
        var z = F.SysTrace("Src/Task.cs", "Step", 4);

        o(z, "Task.Step");
    }