-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from JSkimming/null-created_on
The value created_on can be null
- Loading branch information
Showing
6 changed files
with
46 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace CloudFlare.NET | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using AutoTest.ArgNullEx.Filter; | ||
|
||
/// <summary> | ||
/// Filters out parameters that are <see cref="Nullable"/> value types. | ||
/// </summary> | ||
public sealed class IsNullable : FilterBase, IParameterFilter | ||
{ | ||
/// <summary> | ||
/// Filters out parameters that are <see cref="Nullable"/> value types. | ||
/// </summary> | ||
/// <param name="type">The type.</param> | ||
/// <param name="method">The method.</param> | ||
/// <param name="parameter">The parameter.</param> | ||
/// <returns><see langword="true"/> if the <paramref name="parameter"/> should be excluded; | ||
/// otherwise <see langword="false"/>.</returns> | ||
/// <exception cref="ArgumentNullException">The <paramref name="type"/>, <paramref name="method"/> or | ||
/// <paramref name="parameter"/> parameters are <see langword="null"/>.</exception> | ||
bool IParameterFilter.ExcludeParameter(Type type, MethodBase method, ParameterInfo parameter) | ||
{ | ||
if (type == null) | ||
throw new ArgumentNullException(nameof(type)); | ||
if (method == null) | ||
throw new ArgumentNullException(nameof(method)); | ||
if (parameter == null) | ||
throw new ArgumentNullException(nameof(parameter)); | ||
|
||
return parameter.ParameterType.IsGenericType && | ||
parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>); | ||
} | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
src/Tests/CloudFlare.NET.Tests/Serialization/DnsRecordMinimal.json
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"id": "9a7806061c88ada191ed06f989cc3dac", | ||
"name": "example.com", | ||
"zone_id": "9a7806061c88ada191ed06f989cc3dac" | ||
"zone_id": "9a7806061c88ada191ed06f989cc3dac", | ||
"created_on": null | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"id": "9a7806061c88ada191ed06f989cc3dac", | ||
"name": "example.com" | ||
"name": "example.com", | ||
"created_on": null | ||
} |