Table of Contents

Interface INormalizationStrategy

Namespace
FEFF.TestFixtures.AspNetCore.Randomness
Assembly
FEFF.TestFixtures.AspNetCore.dll

Defines how FakeRandom should handle generated values that fall outside the valid range of the target Random method.

public interface INormalizationStrategy

Methods

NormalizeDouble(double)

Normalizes an out-of-range double value to fit within the valid range [0.0, 1.0).

double NormalizeDouble(double next)

Parameters

next double

The raw generated value.

Returns

double

A normalized value that NextDouble() should return.

NormalizeI32(int, int, int)

Normalizes an out-of-range int value to fit within min (inclusive) and max (exclusive).

int NormalizeI32(int next, int min, int max)

Parameters

next int

The raw generated value.

min int

The inclusive lower bound of the method contract.

max int

The exclusive upper bound of the method contract.

Returns

int

A normalized value that the method should return.

NormalizeI64(long, long, long)

Normalizes an out-of-range long value to fit within min (inclusive) and max (exclusive).

long NormalizeI64(long next, long min, long max)

Parameters

next long

The raw generated value.

min long

The inclusive lower bound of the method contract.

max long

The exclusive upper bound of the method contract.

Returns

long

A normalized value that the method should return.

NormalizeSingle(float)

Normalizes an out-of-range float value to fit within the valid range [0.0, 1.0).

float NormalizeSingle(float next)

Parameters

next float

The raw generated value.

Returns

float

A normalized value that NextSingle() should return.