File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Tynamix.ObjectFiller.Test/BugfixTests Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ namespace ObjectFiller.Test.BugfixTests
88{
99 using Tynamix . ObjectFiller ;
1010
11-
1211
12+ [ TestClass ]
1313 public class Bug87ErrorWhenNameInParentIsSameAsParent
1414 {
1515 public class Parent
@@ -29,11 +29,16 @@ public class Child
2929 public void ParentShallGetFilledWithourError ( )
3030 {
3131 Filler < Parent > filler = new Filler < Parent > ( ) ;
32+ filler . Setup ( )
33+ . OnProperty ( x => x . MakeTheError ) . Use ( 12345 )
34+ . SetupFor < Child > ( )
35+ . OnProperty ( x => x . MakeTheError ) . Use ( "TEST" ) ;
3236
3337 var filledObject = filler . Create ( ) ;
3438 Assert . IsNotNull ( filledObject ) ;
35- Assert . IsNotNull ( filledObject . MakeTheError ) ;
39+ Assert . AreEqual ( 12345 , filledObject . MakeTheError ) ;
3640 Assert . IsFalse ( string . IsNullOrWhiteSpace ( filledObject . Child . MakeTheError ) ) ;
41+ Assert . AreEqual ( "TEST" , filledObject . Child . MakeTheError ) ;
3742 }
3843 }
3944}
Original file line number Diff line number Diff line change @@ -962,7 +962,9 @@ private IEnumerable<PropertyInfo> GetPropertyFromProperties(
962962 IEnumerable < PropertyInfo > properties ,
963963 PropertyInfo property )
964964 {
965- return properties . Where ( x => x . Name == property . Name && x . Module . Equals ( property . Module ) ) ;
965+ return properties . Where ( x => x . Name == property . Name
966+ && x . Module . Equals ( property . Module )
967+ && x . DeclaringType ? . AssemblyQualifiedName == property . DeclaringType ? . AssemblyQualifiedName ) ;
966968 }
967969
968970 /// <summary>
You can’t perform that action at this time.
0 commit comments