Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Random

Hierarchy

  • Random

Index

Methods

Static addDays

  • addDays(date: Date, days: number): Date
  • add days param times day to date

    Parameters

    • date: Date
    • days: number

    Returns Date

    increased date

Static extend2Chars

  • extend2Chars(chars: string): string
  • If chars's length is 2 return chars, if chars's length is 1 return 0${chars}

    Parameters

    • chars: string

      any string

    Returns string

    2 chars string

Static random

  • random<T>(array: Array<T>): T
  • random object in array

    Type parameters

    • T

    Parameters

    • array: Array<T>

    Returns T

    random array item

Static randomAdultAge

  • randomAdultAge(): number
  • random adult age

    Returns number

    random adult count age 18-115

Static randomAdultCount

  • randomAdultCount(): number
  • random adult count

    Returns number

    random adult count between 1-12

Static randomAnswers

  • randomAnswers(): Array<number>
  • random answers array

    Returns Array<number>

    random sub array of [5, 6, 16, 18, 27, 35, 12, 13, 25, 32, 33, 34, 1, 2, 41, 9, 10, 22, 40]

Static randomChildAge

  • randomChildAge(): number
  • random children age

    Returns number

    random children count age 0-17

Static randomChildrenCount

  • randomChildrenCount(): number
  • random children count

    Returns number

    random children count between 0-12

Static randomCoordinate

  • randomCoordinate(): Model.Coordinate
  • random coordinate on the world

    Returns Model.Coordinate

    random coordinate on the world { lat: [(-90)-(90)], lng: [(-180)-(180)] }

Static randomDateRange

  • randomDateRange(): { arrivalDate: string; departureDate: string }
  • random date range

    Returns { arrivalDate: string; departureDate: string }

    random date range for create a trip { arrivalDate: YYYY-MM-DD, departureDate: YYYY-MM-DD } Maximum range is 14.

    • arrivalDate: string
    • departureDate: string

Static randomNewCompanion

  • randomNewCompanion(answers?: number[]): Model.CompanionRequest
  • random companion

    Parameters

    • Default value answers: number[] = [43, 44, 45]

    Returns Model.CompanionRequest

Static randomNewUser

  • randomNewUser(): Model.RegisterRequest
  • random register request.

    Returns Model.RegisterRequest

Static randomNewUserReservation

  • randomNewUserReservation(poiId: string, tripHash: string): Model.UserReservationRequest
  • random reservation

    Parameters

    • poiId: string
    • tripHash: string

    Returns Model.UserReservationRequest

Static randomOffer

  • randomOffer(cityId: 108): Model.OfferAddRequest
  • random trip profile

    Parameters

    • cityId: 108

    Returns Model.OfferAddRequest

Static randomOrder

  • randomOrder<T>(array: Array<T>): Array<T>
  • random ordered array

    Type parameters

    • T

    Parameters

    • array: Array<T>

    Returns Array<T>

    random ordered array of param array items.

Static randomPassword

  • randomPassword(): string
  • random password

    Returns string

    random username start with pass

Static randomTime

  • randomTime(): string
  • random time

    Returns string

    random time between 00:00 and 23:59

Static randomTimeRange

  • randomTimeRange(): { endTime: string; startTime: string }
  • random time range

    Returns { endTime: string; startTime: string }

    random time range for create a trip { startTime: hh:mm, endTime: hh:mm }

    • endTime: string
    • startTime: string

Static randomTripProfile

  • randomTripProfile(cityId?: number): Model.TripProfile
  • random trip profile

    Parameters

    • Default value cityId: number = 109

    Returns Model.TripProfile

Static randomUser

  • randomUser(allAnswers?: number[]): Model.UserUpdateRequest
  • random user update request.

    Parameters

    • Default value allAnswers: number[] = [1, 2, 41]

    Returns Model.UserUpdateRequest

Static randomUserPassword

  • randomUserPassword(): Model.UserUpdateRequest

Static randomUsername

  • randomUsername(): string
  • random username

    Returns string

    random username start with Uu and length is 9 chars