Exemplo n.º 1
0
 public Property CompleteSafetyMeansEveryFloorSafety()
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => CompleteSafetyIsEqualToEveryFloorSafety(state))
            .And(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                             state => CompleteSafetyIsEqualToEveryFloorSafety(state))));
 }
Exemplo n.º 2
0
 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)));
 }
Exemplo n.º 3
0
 public static Property TestAllMoves(Func <State, State, bool> predicate)
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => state.PossibleMoves().All(moved => predicate(state, moved))));
 }
Exemplo n.º 4
0
 public Property MovesAreDistinct()
 {
     return(Prop.ForAll(StateGen.ValidStates().ToArbitrary(),
                        state => state.PossibleMoves().Distinct().Count() == state.PossibleMoves().Count()));
 }