6
6
namespace FluentAssertions . Equivalency ;
7
7
8
8
/// <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.
10
10
/// </summary>
11
11
internal class Field : Node , IMember
12
12
{
13
13
private readonly FieldInfo fieldInfo ;
14
14
private bool ? isBrowsable ;
15
15
16
16
public Field ( FieldInfo fieldInfo , INode parent )
17
- : this ( fieldInfo . ReflectedType , fieldInfo , parent )
18
- {
19
- }
20
-
21
- public Field ( Type reflectedType , FieldInfo fieldInfo , INode parent )
22
17
{
23
18
this . fieldInfo = fieldInfo ;
24
19
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 } ") ;
27
23
GetSubjectId = parent . GetSubjectId ;
28
- Name = fieldInfo . Name ;
29
24
Type = fieldInfo . FieldType ;
30
25
ParentType = fieldInfo . DeclaringType ;
31
26
RootIsCollection = parent . RootIsCollection ;
@@ -40,8 +35,6 @@ public object GetValue(object obj)
40
35
41
36
public Type DeclaringType { get ; set ; }
42
37
43
- public override string Description => $ "field { GetSubjectId ( ) . Combine ( PathAndName ) } ";
44
-
45
38
public CSharpAccessModifier GetterAccessibility => fieldInfo . GetCSharpAccessModifier ( ) ;
46
39
47
40
public CSharpAccessModifier SetterAccessibility => fieldInfo . GetCSharpAccessModifier ( ) ;
0 commit comments