-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug when passing an explicit comparer or immutable type.
- Refactor recursive verify to share logic for fields and properties.
- Loading branch information
1 parent
502aebe
commit ee5224e
Showing
85 changed files
with
981 additions
and
618 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
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,15 +1,39 @@ | ||
namespace Gu.State.Tests.CopyTests.PropertyValues | ||
{ | ||
using System; | ||
using System.Reflection; | ||
|
||
public class Verify : VerifyTests | ||
{ | ||
public override void VerifyMethod<T>() | ||
{ | ||
Copy.VerifyCanCopyPropertyValues<T>(); | ||
} | ||
|
||
public override void VerifyMethod<T>(ReferenceHandling referenceHandling) | ||
public override void VerifyMethod<T>( | ||
ReferenceHandling referenceHandling, | ||
string excludedMembers = null, | ||
Type ignoredType = null, | ||
Type immutableType = null) | ||
{ | ||
Copy.VerifyCanCopyPropertyValues<T>(referenceHandling); | ||
var builder = PropertiesSettings.Build(); | ||
if (excludedMembers != null) | ||
{ | ||
builder.IgnoreProperty<T>(excludedMembers); | ||
} | ||
|
||
if (ignoredType != null) | ||
{ | ||
builder.AddImmutableType(ignoredType); | ||
} | ||
|
||
if (immutableType != null) | ||
{ | ||
builder.AddImmutableType(immutableType); | ||
} | ||
|
||
var settings = builder.CreateSettings(referenceHandling); | ||
Copy.VerifyCanCopyPropertyValues<T>(settings); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.