public void ExecuteThrowFailedLoadStateException() { var action = new DailyReward0 { avatarAddress = _avatarAddress, }; Assert.Throws <FailedLoadStateException>(() => action.Execute(new ActionContext() { PreviousStates = new State(), Signer = _agentAddress, BlockIndex = 0, }) ); }
public void Execute() { var dailyRewardAction = new DailyReward0 { avatarAddress = _avatarAddress, }; var nextState = dailyRewardAction.Execute(new ActionContext { BlockIndex = 0, PreviousStates = _initialState, Rehearsal = false, Signer = _agentAddress, }); var gameConfigState = nextState.GetGameConfigState(); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); Assert.Equal(gameConfigState.ActionPointMax, nextAvatarState.actionPoint); }