public void Send(enLogType logType, T dataValue) { this._logType = logType; this._dataValue = dataValue; this._currentState = _senderState["PrepareState"]; this._currentState.Execute(); this._currentState = _senderState["ProcessState"]; this._currentState.Execute(); }
public void Should_ChangeStateToInitialState_When_ExecuteInitial() { //Arrange string expect = "InitialState", actual = string.Empty; //Act this._ctx.Initial(); ISenderState currentState = this._ctx.CurrentState; actual = currentState.StateName; //Assert actual.Should().NotBeEmpty().And.Be(expect); }
public void Should_ChangeStateToProcessState_When_ExecuteSend() { //Arrange string expect = "ProcessState", actual = string.Empty; object dataValue = new object(); //Act this._ctx.Initial(); this._ctx.Send(enLogType.BO, dataValue); ISenderState currentState = this._ctx.CurrentState; actual = currentState.StateName; actual.Should().NotBeEmpty().And.Be(expect); }
public void Initial() { this._currentState = _senderState["InitialState"]; this._currentState.Execute(); }