Example #1
0
        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);
        }
Example #2
0
        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);
        }