Skip to content

TestingUtils Methods

Collection of test utilities

CreateDefaultLoggerFactory(string)

static
View source
public static ILoggerFactory CreateDefaultLoggerFactory(string filePath)
Create the default logger factory, which would configure logger factory with a FileLoggerProvider that writes logs to filePath and console. by default;

Parameters

filePathstring
The file path.

Returns

ILoggerFactory.

CreateDefaultLoggerFactory(string, LoggerFilterOptions)

static
View source
public static ILoggerFactory CreateDefaultLoggerFactory(string filePath, LoggerFilterOptions filters)
Create the default logger factory, which would configure logger factory with a FileLoggerProvider that writes logs to filePath and console. by default;

Parameters

filePathstring
the logger file path
filtersLoggerFilterOptions
log filters you want to configure your logging with

CreateTraceFileName(string, string)

static
View source
public static string CreateTraceFileName(string nodeName, string clusterId)
Create trace file name for a specific node or client in a specific deployment

Parameters

nodeNamestring
Name of the node.
clusterIdstring
The cluster identifier.

Returns

The new trace file name.

Multiply(TimeSpan, double)

static
View source
public static TimeSpan Multiply(TimeSpan time, double value)
Multiply a timeout by a value

Parameters

timeTimeSpan
The time.
valuedouble
The value.

Returns

The resulting time span value.

WaitUntilAsync(Func<bool, Task<bool>>, TimeSpan, TimeSpan?)

static
View source
public static Task WaitUntilAsync(Func<bool, Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = null)
Run the predicate until it succeed or times out

Parameters

predicateFunc<bool, Task<bool>>
The predicate to run
timeoutTimeSpan
The timeout value
delayOnFailTimeSpan?
The time to delay next call upon failure

Returns

True if the predicate succeed, false otherwise