public void We_should_have_different_data() { var firstPerson = RepositoryOption.GetUser(2).ValueOrDefault(); var secondPerson = RepositoryOption.GetUser(3).ValueOrDefault(); firstPerson.Name.Should().NotBe(secondPerson.Name); }
public Option <Reservation> RentVehicke(int userId, int vehicleId) { var user = RepositoryOption.GetUser(userId); var car = RepositoryOption.GetCar(vehicleId); var oldReservation = RepositoryOption.GetReservationsByUser(userId); if (user.HasValue && car.HasValue && !oldReservation.HasValue) { var reservation = new Reservation() { Id = 1, UserId = userId, VehicleId = vehicleId }; Repository._reservations.Add(reservation); return(reservation.Some()); } return(Optional.Option.None <Reservation>()); }
public void We_should_have_only_100_cars() { RepositoryOption.GetCar(100).HasValue.Should().BeFalse(); }