-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: address some static code analysis issues, exposed by the latest …
…analyzer (#87) * fix(CS8604): in older runtimes, IEqualityComparer<> did not use nullable annotation. Fix with string polyfill for Arg.Any. * fix(CA2007): use `ConfigureAwait` on awaitable async stream * refactor(CA1031): use `TryAddWithoutValidation` to avoid exceptions and to skip adding header if not supported. * fix(SYSLIB0051): mark serializable/binary formatter support as obsolete * refactor(CA2208): rather, catch the invalid enum value in ctor.
- Loading branch information
Showing
7 changed files
with
46 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace MockHttp.Json; | ||
|
||
/// <summary> | ||
/// To deal with runtime API differences around mocking with nullable. | ||
/// </summary> | ||
internal static class ArgAny | ||
{ | ||
#if NETCOREAPP3_1_OR_GREATER | ||
public static ref string? String() => ref Arg.Any<string?>(); | ||
#else | ||
public static ref string String() => ref Arg.Any<string>(); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters