Esempio n. 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");
    }
Esempio n. 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;
    }
Esempio n. 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");
    }
Esempio n. 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");
    }
Esempio n. 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")) == '*');
 }
Esempio n. 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");
    }
Esempio n. 7
0
 [Test] public void StatusWithInversionPrefix()
 {
     o(F.Status(!done.Via(log && "Attack", "A", "B")), "  !A.B (Attack)");
 }
Esempio n. 8
0
 [Test] public void Status()
 {
     o(F.Status(done.Via(log && "Out of range", "NPC", "Attack")),
       "* NPC.Attack (Out of range)");
 }
Esempio n. 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");
    }
Esempio n. 10
0
 [Test] public void Decorator()
 {
     o(F.Decorator(new Cooldown()), "<C>");
 }
Esempio n. 11
0
 [SetUp] public void Setup() => F.UseASCII();
Esempio n. 12
0
    [Test] public void SysTrace()
    {
        var z = F.SysTrace("Src/Task.cs", "Step", 4);

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