public void ApplyShouldWorkOnSelectedPropertyOfImmutableState() { ImmutableTree state = new ImmutableTree(1, false); ReducerComposer <ImmutableTree> composer = new ReducerComposer <ImmutableTree>(); composer.AddSubTreeReducer(new ImmutableIntPropReducer()) .AddSubTreeReducer(new ImmutableBoolPropReducer()); state = composer.Apply(state, ""); Assert.AreEqual(2, state.IntProp); Assert.AreEqual(true, state.BoolProp); }
public void ApplyShouldWorkOnSelectedPropertyOfState() { Tree state = new Tree(); state.IntProp = 1; state.BoolProp = false; ReducerComposer <Tree> composer = new ReducerComposer <Tree>(); composer.AddSubTreeReducer(new IntPropReducer()) .AddSubTreeReducer(new BoolPropReducer()); composer.Apply(state, ""); Assert.AreEqual(2, state.IntProp); Assert.AreEqual(true, state.BoolProp); }