public StateTests() { this.reducer = Mock.Of <IStateReducer <TestStateSubject> >(MockBehavior.Strict); this.provider = Mock.Of <IActionProvider <TestStateSubject> >(MockBehavior.Strict); this.handler = Mock.Of <IActionHandler <TestAction, TestStateSubject> >(MockBehavior.Strict); this.context = new TestStateSubject(); this.state = new State <TestStateSubject>(TestStateId.New, this.context, this.reducer); }
public void SetStateShouldCreateNewStateObjectWithStateProvidedProperties() { // Arrange var context = new TestStateSubject(); // Act this.reducer.SetState(TestStateId.New, context); // Assert Assert.NotNull(context.State); Assert.Equal(TestStateId.New, context.State.StateId); Assert.Equal(context, context.State.Subject); }