Beispiel #1
0
    public void SetToPickedState_CallsPickedStateSetPickedII()
    {
        TestIITAMStateEngine engine   = new TestIITAMStateEngine();
        IItemIcon            pickedII = Substitute.For <IItemIcon>();

        engine.SetToPickedState(pickedII);

        engine.GetPickedState().Received(1).SetPickedII(pickedII);
    }
Beispiel #2
0
    public void SetIITAM_CallsBothStatesSetIITAM()
    {
        TestIITAMStateEngine        engine = new TestIITAMStateEngine();
        IItemIconTransactionManager iiTAM  = Substitute.For <IItemIconTransactionManager>();

        engine.SetIITAM(iiTAM);

        engine.GetPickedState().Received(1).SetIITAM(iiTAM);
        engine.GetDefaultState().Received(1).SetIITAM(iiTAM);
    }
Beispiel #3
0
    public void SetToPickedState_WhileInPickedState_DoesNotCallPickedStateOnEnterTwice()
    {
        TestIITAMStateEngine engine = new TestIITAMStateEngine();

        Assert.That(engine.IsInPickedUpState(), Is.False);
        engine.SetToPickedState(Substitute.For <IItemIcon>());
        Assert.That(engine.IsInPickedUpState(), Is.True);

        engine.SetToPickedState(Substitute.For <IItemIcon>());

        engine.GetPickedState().Received(1).OnEnter();
    }