Table of Contents

Class ReturnAsIsNormalization

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

A normalization strategy that returns the generated value unchanged, regardless of whether it falls inside or outside the valid range for the target method.

public class ReturnAsIsNormalization : INormalizationStrategy
Inheritance
ReturnAsIsNormalization
Implements
Inherited Members

Remarks

Use this strategy when you want FakeRandom to produce exact preconfigured values without any clamping, mapping, or validation — even if those values would be considered invalid under the normal Random contract.

Methods

NormalizeDouble(double)

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

public 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).

public 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).

public 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).

public float NormalizeSingle(float next)

Parameters

next float

The raw generated value.

Returns

float

A normalized value that NextSingle() should return.