示例#1
0
    public async void YielderIsNotActiveWhenAsserting()
    {
        await ToSignal(UntilTimeout(0.1), YIELD);

        bool result = (bool)Yielder.Call("is_active");

        Assert.IsTrue(!result, "Then yielder is not active");
    }
示例#2
0
    public async void WhenASignalBeingYieldedOnIsEmittedTheYielderIsStopped()
    {
        CallDeferred("emit_signal", "abc");
        await ToSignal(UntilSignal(this, "abc", 0.3), YIELD);

        bool paused = (bool)Yielder.Call("get", "paused");

        Assert.IsTrue(paused, "Then the yielder is paused");
    }
示例#3
0
    public async void WhenTheYielderTimesOut()
    {
        await ToSignal(UntilTimeout(0.1), YIELD);

        bool paused    = (bool)Yielder.Call("get", "paused");
        bool connected = (bool)Yielder.Call("is_connected", "timeout", Yielder, "_on_resume");

        Assert.IsTrue(paused, "Then the yielder is paused");
        Assert.IsTrue(!connected, "The timeout signal of the yielder is not connected");
    }
示例#4
0
    public async void WhenYielderIsFinishedSignalsAreDisconnected()
    {
        await ToSignal(UntilSignal(this, "abc", 0.1), YIELD);

        bool connected  = (bool)Yielder.Call("is_connected", "timeout", Yielder, "_on_resume");
        bool connected2 = IsConnected("abc", Yielder, "_on_resume");

        Assert.IsTrue(!connected, "Then the timeout signal is disconnected");
        Assert.IsTrue(!connected2, "Then the signal signal is disconnected");
    }
示例#5
0
    public async void WhenTheYielderHearsOurSignal()
    {
        CallDeferred("emit_signal", "abc");
        await ToSignal(UntilSignal(this, "abc", 0.1), YIELD);

        bool paused        = (bool)Yielder.Call("get", "paused");
        bool connected     = (bool)Yielder.Call("is_connected", "timeout", Yielder, "_on_resume");
        bool our_connected = IsConnected("abc", Yielder, "_on_resume");

        Assert.IsTrue(paused, "Then the yielder is paused");
        Assert.IsTrue(!connected, "Then the timeout signal of the yielder is disconnected");
        Assert.IsTrue(!our_connected, "Then our signal to the yielder is disconnected");
    }