public void SetToPickedState_CallsPickedStateSetPickedII() { TestIITAMStateEngine engine = new TestIITAMStateEngine(); IItemIcon pickedII = Substitute.For <IItemIcon>(); engine.SetToPickedState(pickedII); engine.GetPickedState().Received(1).SetPickedII(pickedII); }
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); }
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(); }