rspec/rules/S4581/description.adoc
2022-04-22 17:08:57 +02:00

8 lines
446 B
Plaintext

When the syntax `new Guid()` (i.e. parameterless instantiation) is used, it must be that one of three things is wanted:
. An empty GUID, in which case `Guid.Empty` is clearer.
. A randomly-generated GUID, in which case `Guid.NewGuid()` should be used.
. A new GUID with a specific initialization, in which case the initialization parameter is missing.
This rule raises an issue when a parameterless instantiation of the `Guid` struct is found.