forked from MapsterMapper/Mapster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ReflectionUtils.IsPoco does not check for IEnumerable.
- Loading branch information
Showing
3 changed files
with
41 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Shouldly; | ||
using System; | ||
using System.Collections; | ||
|
||
namespace Mapster.Tests | ||
{ | ||
[TestClass] | ||
public class WhenMappingIEnumerableClasses | ||
{ | ||
public class ClassA | ||
{ | ||
public int Id { get; set; } | ||
} | ||
|
||
public class ClassB : IEnumerable | ||
{ | ||
|
||
public int Id { get; set; } | ||
|
||
public IEnumerator GetEnumerator() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
[TestMethod] | ||
public void Map_To_IEnumerable_Class_Should_Pass() | ||
{ | ||
ClassA classA = new ClassA() | ||
{ | ||
Id = 123 | ||
}; | ||
|
||
ClassB classB = classA.Adapt<ClassB>(); | ||
classB.Id.ShouldBe(classA.Id); | ||
} | ||
|
||
} | ||
} |
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