66namespace FluentAssertions . Equivalency ;
77
88/// <summary>
9- /// A specialized type of <see cref="INode "/> that represents a field of an object in a structural equivalency assertion.
9+ /// A specialized type of <see cref="INode"/> that represents a field of an object in a structural equivalency assertion.
1010/// </summary>
1111internal class Field : Node , IMember
1212{
1313 private readonly FieldInfo fieldInfo ;
1414 private bool ? isBrowsable ;
1515
1616 public Field ( FieldInfo fieldInfo , INode parent )
17- : this ( fieldInfo . ReflectedType , fieldInfo , parent )
18- {
19- }
20-
21- public Field ( Type reflectedType , FieldInfo fieldInfo , INode parent )
2217 {
2318 this . fieldInfo = fieldInfo ;
2419 DeclaringType = fieldInfo . DeclaringType ;
25- ReflectedType = reflectedType ;
26- Path = parent . PathAndName ;
20+ ReflectedType = fieldInfo . ReflectedType ;
21+ Subject = new Pathway ( parent . Subject . PathAndName , fieldInfo . Name , pathAndName => $ "field { parent . GetSubjectId ( ) . Combine ( pathAndName ) } ") ;
22+ Expectation = new Pathway ( parent . Expectation . PathAndName , fieldInfo . Name , pathAndName => $ "field { pathAndName } ") ;
2723 GetSubjectId = parent . GetSubjectId ;
28- Name = fieldInfo . Name ;
2924 Type = fieldInfo . FieldType ;
3025 ParentType = fieldInfo . DeclaringType ;
3126 RootIsCollection = parent . RootIsCollection ;
@@ -40,8 +35,6 @@ public object GetValue(object obj)
4035
4136 public Type DeclaringType { get ; set ; }
4237
43- public override string Description => $ "field { GetSubjectId ( ) . Combine ( PathAndName ) } ";
44-
4538 public CSharpAccessModifier GetterAccessibility => fieldInfo . GetCSharpAccessModifier ( ) ;
4639
4740 public CSharpAccessModifier SetterAccessibility => fieldInfo . GetCSharpAccessModifier ( ) ;
0 commit comments