# Guids
By default guids are sanitized during verification. This is done by finding each guid and taking a counter based that that specific guid. That counter is then used replace the guid values. This allows for repeatable tests when guid values are changing.
```cs
var guid = Guid.NewGuid();
var target = new GuidTarget
{
Guid = guid,
GuidNullable = guid,
GuidString = guid.ToString(),
OtherGuid = Guid.NewGuid()
};
await Verify(target);
```
snippet source | anchor
Results in the following:
```txt
{
Guid: Guid_1,
GuidNullable: Guid_1,
GuidString: Guid_1,
OtherGuid: Guid_2
}
```
snippet source | anchor
## Disable
To disable this behavior use:
### Instance
```cs
var settings = new VerifySettings();
settings.DontScrubGuids();
await Verify(target, settings);
```
snippet source | anchor
### Fluent
```cs
await Verify(target)
.DontScrubGuids();
```
snippet source | anchor
### Globally
```cs
VerifierSettings.DontScrubGuids();
```
snippet source | anchor
## Inline Guids
Strings containing inline Guids can also be scrubbed. To enable this behavior, use:
### Instance
```cs
[Fact]
public Task ScrubInlineGuidsInstance()
{
var settings = new VerifySettings();
settings.ScrubInlineGuids();
return Verify(
"content 651ad409-fc30-4b12-a47e-616d3f953e4c content",
settings);
}
```
snippet source | anchor
### Fluent
```cs
[Fact]
public Task ScrubInlineGuidsFluent() =>
Verify("content 651ad409-fc30-4b12-a47e-616d3f953e4c content")
.ScrubInlineGuids();
```
snippet source | anchor
### Globally
```cs
public static class ModuleInitializer
{
[ModuleInitializer]
public static void Init() =>
VerifierSettings.ScrubInlineGuids();
}
```
snippet source | anchor
## Named Guid
Specific Guids can be named. When any of those Guids are found, it will be replaced with the supplied name.
### Instance
```cs
[Fact]
public Task NamedGuidInstance()
{
var settings = new VerifySettings();
var guid = new Guid("c8eeaf99-d5c4-4341-8543-4597c3fd40d9");
settings.AddNamedGuid(guid, "instanceNamed");
return Verify(
new
{
value = guid
},
settings);
}
```
snippet source | anchor
### Instance
```cs
[Fact]
public Task NamedGuidFluent()
{
var guid = new Guid("c8eeaf99-d5c4-4341-8543-4597c3fd40d9");
return Verify(
new
{
value = guid
})
.AddNamedGuid(guid, "instanceNamed");
}
```
snippet source | anchor
### Globally
```cs
[ModuleInitializer]
public static void Init() => VerifierSettings.AddNamedGuid(new("c8eeaf99-d5c4-4341-8543-4597c3fd40c9"), "guidName");
```
snippet source | anchor
### Inferred Name
The name can be inferred from the variable name by omitting the name argument:
```cs
[Fact]
public Task InferredNamedGuidFluent()
{
var namedGuid = new Guid("c8eeaf99-d5c4-4341-8543-4597c3fd40d9");
return Verify(
new
{
value = namedGuid
})
.AddNamedGuid(namedGuid);
}
```
snippet source | anchor
Result:
```txt
{
value: namedGuid
}
```
snippet source | anchor