Example #1
0
 public Property CompleteSafetyMeansEveryFloorSafety()
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => CompleteSafetyIsEqualToEveryFloorSafety(state))
            .And(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                             state => CompleteSafetyIsEqualToEveryFloorSafety(state))));
 }
 public Property MoveCountIsCorrect()
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state =>
                        state.PossibleMoves().Count() ==
                        CombinationCount(state.ChipFloors[state.ElevatorFloor].Cardinality() +
                                         state.GeneratorFloors[state.ElevatorFloor].Cardinality()) || CheckState(state)));
 }
 public static Property TestAllMoves(Func <State, State, bool> predicate)
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => state.PossibleMoves().All(moved => predicate(state, moved))));
 }
 public Property MovesAreDistinct()
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => state.PossibleMoves().Distinct().Count() == state.PossibleMoves().Count()));
 }