Microsoft.Extensions.TimeProvider.Testing
Specifies that null is allowed as an input even if the corresponding type disallows it.
Specifies that null is disallowed as an input even if the corresponding type allows it.
Specifies that an output may be null even if the corresponding type disallows it.
Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.
Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter may be .
Gets the return value condition.
Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter will not be .
Gets the return value condition.
Specifies that the output will be non-null if the named parameter is non-null.
Initializes the attribute with the associated parameter name.
The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
Gets the associated parameter name.
Applied to a method that will never return under any circumstance.
Specifies that the method will not return if the associated Boolean parameter is passed the specified value.
Initializes the attribute with the specified parameter value.
The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
the associated parameter matches this value.
Gets the condition parameter value.
Specifies that the method or property will ensure that the listed field and property members have not-null values.
Initializes the attribute with a field or property member.
The field or property member that is promised to be not-null.
Initializes the attribute with the list of field and property members.
The list of field and property members that are promised to be not-null.
Gets field or property member names.
Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.
Initializes the attribute with the specified return value condition and a field or property member.
The return value condition. If the method returns this value, the associated parameter will not be .
The field or property member that is promised to be not-null.
Initializes the attribute with the specified return value condition and list of field and property members.
The return value condition. If the method returns this value, the associated parameter will not be .
The list of field and property members that are promised to be not-null.
Gets the return value condition.
Gets field or property member names.
Indicates that certain members on a specified are accessed dynamically,
for example through .
This allows tools to understand which members are being accessed during the execution
of a program.
This attribute is valid on members whose type is or .
When this attribute is applied to a location of type , the assumption is
that the string represents a fully qualified type name.
When this attribute is applied to a class, interface, or struct, the members specified
can be accessed dynamically on instances returned from calling
on instances of that class, interface, or struct.
If the attribute is applied to a method it's treated as a special case and it implies
the attribute should be applied to the "this" parameter of the method. As such the attribute
should only be used on instance methods of types assignable to System.Type (or string, but no methods
will use it there).
Initializes a new instance of the class
with the specified member types.
The types of members dynamically accessed.
Gets the which specifies the type
of members dynamically accessed.
Specifies the types of members that are dynamically accessed.
This enumeration has a attribute that allows a
bitwise combination of its member values.
Specifies no members.
Specifies the default, parameterless public constructor.
Specifies all public constructors.
Specifies all non-public constructors.
Specifies all public methods.
Specifies all non-public methods.
Specifies all public fields.
Specifies all non-public fields.
Specifies all public nested types.
Specifies all non-public nested types.
Specifies all public properties.
Specifies all non-public properties.
Specifies all public events.
Specifies all non-public events.
Specifies all interfaces implemented by the type.
Specifies all members.
States a dependency that one member has on another.
This can be used to inform tooling of a dependency that is otherwise not evident purely from
metadata and IL, for example a member relied on via reflection.
Initializes a new instance of the class
with the specified signature of a member on the same type as the consumer.
The signature of the member depended on.
Initializes a new instance of the class
with the specified signature of a member on a .
The signature of the member depended on.
The containing .
Initializes a new instance of the class
with the specified signature of a member on a type in an assembly.
The signature of the member depended on.
The full name of the type containing the specified member.
The assembly name of the type containing the specified member.
Initializes a new instance of the class
with the specified types of members on a .
The types of members depended on.
The containing the specified members.
Initializes a new instance of the class
with the specified types of members on a type in an assembly.
The types of members depended on.
The full name of the type containing the specified members.
The assembly name of the type containing the specified members.
Gets the signature of the member depended on.
Either must be a valid string or
must not equal , but not both.
Gets the which specifies the type
of members depended on.
Either must be a valid string or
must not equal , but not both.
Gets the containing the specified member.
If neither nor are specified,
the type of the consumer is assumed.
Gets the full name of the type containing the specified member.
If neither nor are specified,
the type of the consumer is assumed.
Gets the assembly name of the specified type.
is only valid when is specified.
Gets or sets the condition in which the dependency is applicable, e.g. "DEBUG".
/// Indicates that the specified member requires assembly files to be on disk.
Initializes a new instance of the class.
Initializes a new instance of the class.
A message that contains information about the need for assembly files to be on disk.
Gets an optional message that contains information about the need for
assembly files to be on disk.
Gets or sets an optional URL that contains more information about the member,
why it requires assembly files to be on disk, and what options a consumer has
to deal with it.
Indicates that the specified method requires the ability to generate new code at runtime,
for example through .
This allows tools to understand which methods are unsafe to call when compiling ahead of time.
Initializes a new instance of the class
with the specified message.
A message that contains information about the usage of dynamic code.
Gets a message that contains information about the usage of dynamic code.
Gets or sets an optional URL that contains more information about the method,
why it requires dynamic code, and what options a consumer has to deal with it.
/// Indicates that the specified method requires dynamic access to code that is not referenced
statically, for example through .
This allows tools to understand which methods are unsafe to call when removing unreferenced
code from an application.
Initializes a new instance of the class
with the specified message.
A message that contains information about the usage of unreferenced code.
Gets a message that contains information about the usage of unreferenced code.
Gets or sets an optional URL that contains more information about the method,
why it requires unreferenced code, and what options a consumer has to deal with it.
/// Suppresses reporting of a specific rule violation, allowing multiple suppressions on a
single code artifact.
is different than
in that it doesn't have a
. So it is always preserved in the compiled assembly.
Initializes a new instance of the
class, specifying the category of the tool and the identifier for an analysis rule.
The category for the attribute.
The identifier of the analysis rule the attribute applies to.
Gets the category identifying the classification of the attribute.
The property describes the tool or tool analysis category
for which a message suppression attribute applies.
Gets the identifier of the analysis tool rule to be suppressed.
Concatenated together, the and
properties form a unique check identifier.
Gets or sets the scope of the code that is relevant for the attribute.
The Scope property is an optional argument that specifies the metadata scope for which
the attribute is relevant.
Gets or sets a fully qualified path that represents the target of the attribute.
The property is an optional argument identifying the analysis target
of the attribute. An example value is "System.IO.Stream.ctor():System.Void".
Because it is fully qualified, it can be long, particularly for targets such as parameters.
The analysis tool user interface should be capable of automatically formatting the parameter.
Gets or sets an optional argument expanding on exclusion criteria.
The property is an optional argument that specifies additional
exclusion where the literal metadata target is not sufficiently precise. For example,
the cannot be applied within a method,
and it may be desirable to suppress a violation against a statement in the method that will
give a rule violation, but not against all statements in the method.
Gets or sets the justification for suppressing the code analysis message.
Tags parameter that should be filled with specific caller name.
Initializes a new instance of the class.
Function parameter to take the name from.
Gets name of the function parameter that name should be taken from.
Used to indicate to the compiler that the .locals init
flag should not be set in method headers.
This attribute is unsafe because it may reveal uninitialized memory to
the application in certain instances (e.g., reading from uninitialized
stackalloc'd memory). If applied to a method directly, the attribute
applies to that method and all nested functions (lambdas, local
functions) below it. If applied to a type or module, it applies to all
methods nested inside. This attribute is intentionally not permitted on
assemblies. Use at the module level instead to apply to multiple type
declarations.
Various diagnostic IDs reported by this repo.
When adding a new diagnostic ID, add a corresponding suppression to the root Directory.Build.targets file,
and add a documentation entry to docs/list-of-diagnostics.md.
Experiments supported by this repo.
Defines static methods used to throw exceptions.
The main purpose is to reduce code size, improve performance, and standardize exception
messages.
Throws an if the specified argument is .
Argument type to be checked for .
Object to be checked for .
The name of the parameter being checked.
The original value of .
Throws an if the specified argument is ,
or if the specified member is .
Argument type to be checked for .
Member type to be checked for .
Argument to be checked for .
Object member to be checked for .
The name of the parameter being checked.
The name of the member.
The original value of .
Throws.IfNullOrMemberNull(myObject, myObject?.MyProperty)
Throws an if the specified member is .
Argument type.
Member type to be checked for .
Argument to which member belongs.
Object member to be checked for .
The name of the parameter being checked.
The name of the member.
The original value of .
Throws.IfMemberNull(myObject, myObject.MyProperty)
Throws either an or an
if the specified string is or whitespace respectively.
String to be checked for or whitespace.
The name of the parameter being checked.
The original value of .
Throws an if the string is ,
or if it is empty.
String to be checked for or empty.
The name of the parameter being checked.
The original value of .
Throws an if the argument's buffer size is less than the required buffer size.
The actual buffer size.
The required buffer size.
The name of the parameter to be checked.
Throws an if the enum value is not valid.
The argument to evaluate.
The name of the parameter being checked.
The type of the enumeration.
The original value of .
Throws an if the collection is ,
or if it is empty.
The collection to evaluate.
The name of the parameter being checked.
The type of objects in the collection.
The original value of .
Throws an .
The name of the parameter that caused the exception.
Throws an .
The name of the parameter that caused the exception.
A message that describes the error.
Throws an .
The name of the parameter that caused the exception.
Throws an .
The name of the parameter that caused the exception.
A message that describes the error.
Throws an .
The name of the parameter that caused the exception.
The value of the argument that caused this exception.
A message that describes the error.
Throws an .
The name of the parameter that caused the exception.
A message that describes the error.
Throws an .
The name of the parameter that caused the exception.
A message that describes the error.
The exception that is the cause of the current exception.
If the is not a , the current exception is raised in a catch
block that handles the inner exception.
Throws an .
A message that describes the error.
Throws an .
A message that describes the error.
The exception that is the cause of the current exception.
Throws an if the specified number is less than min.
Number to be expected being less than min.
The number that must be less than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater than max.
Number to be expected being greater than max.
The number that must be greater than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less or equal than min.
Number to be expected being less or equal than min.
The number that must be less or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater or equal than max.
Number to be expected being greater or equal than max.
The number that must be greater or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is not in the specified range.
Number to be expected being greater or equal than max.
The lower bound of the allowed range of argument values.
The upper bound of the allowed range of argument values.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is equal to 0.
Number to be expected being not equal to zero.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less than min.
Number to be expected being less than min.
The number that must be less than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater than max.
Number to be expected being greater than max.
The number that must be greater than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less or equal than min.
Number to be expected being less or equal than min.
The number that must be less or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater or equal than max.
Number to be expected being greater or equal than max.
The number that must be greater or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is not in the specified range.
Number to be expected being greater or equal than max.
The lower bound of the allowed range of argument values.
The upper bound of the allowed range of argument values.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is equal to 0.
Number to be expected being not equal to zero.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less than min.
Number to be expected being less than min.
The number that must be less than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater than max.
Number to be expected being greater than max.
The number that must be greater than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less or equal than min.
Number to be expected being less or equal than min.
The number that must be less or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater or equal than max.
Number to be expected being greater or equal than max.
The number that must be greater or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is not in the specified range.
Number to be expected being greater or equal than max.
The lower bound of the allowed range of argument values.
The upper bound of the allowed range of argument values.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is equal to 0.
Number to be expected being not equal to zero.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less than min.
Number to be expected being less than min.
The number that must be less than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater than max.
Number to be expected being greater than max.
The number that must be greater than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less or equal than min.
Number to be expected being less or equal than min.
The number that must be less or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater or equal than max.
Number to be expected being greater or equal than max.
The number that must be greater or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is not in the specified range.
Number to be expected being greater or equal than max.
The lower bound of the allowed range of argument values.
The upper bound of the allowed range of argument values.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is equal to 0.
Number to be expected being not equal to zero.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less than min.
Number to be expected being less than min.
The number that must be less than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater than max.
Number to be expected being greater than max.
The number that must be greater than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is less or equal than min.
Number to be expected being less or equal than min.
The number that must be less or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is greater or equal than max.
Number to be expected being greater or equal than max.
The number that must be greater or equal than the argument.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is not in the specified range.
Number to be expected being greater or equal than max.
The lower bound of the allowed range of argument values.
The upper bound of the allowed range of argument values.
The name of the parameter being checked.
The original value of .
Throws an if the specified number is equal to 0.
Number to be expected being not equal to zero.
The name of the parameter being checked.
The original value of .
Represents a synthetic time provider that can be used to enable deterministic behavior in tests.
Initializes a new instance of the class.
This creates a provider whose time is initially set to midnight January 1st 2000.
The provider is set to not automatically advance time each time it is read.
Initializes a new instance of the class.
The initial time and date reported by the provider.
The provider is set to not automatically advance time each time it is read.
Gets the starting date and time for this provider.
Gets or sets the amount of time by which time advances whenever the clock is read.
This defaults to .
The time value is less than .
Advances the date and time in the UTC time zone.
The date and time in the UTC time zone.
The supplied time value is before the current time.
This method simply advances time. If the time is set forward beyond the
trigger point of any outstanding timers, those timers will immediately trigger.
This is unlike the method, which has no impact
on timers.
Advances time by a specific amount.
The amount of time to advance the clock by.
Advancing time affects the timers created from this provider, and all other operations that are directly or
indirectly using this provider as a time source. Whereas when using , time
marches forward automatically in hardware, for the fake time provider the application is responsible for
doing this explicitly by calling this method.
The time value is less than .
Sets the date and time in the UTC time zone.
The date and time in the UTC time zone.
This method updates the current time, and has no impact on outstanding
timers. This is similar to what happens in a real system when the system's
time is changed.
Sets the local time zone.
The local time zone.
Gets the amount by which the value from increments per second.
This is fixed to the value of .
Returns a string representation this provider's idea of current time.
A string representing the provider's current time.