File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
test/DotNetToolkit.Repository.Test Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ namespace DotNetToolkit . Repository . Test . Data
2+ {
3+ public class Customer
4+ {
5+ public int Id { get ; set ; }
6+ public string Name { get ; set ; }
7+ public CustomerAddress Address { get ; set ; }
8+ public CustomerPhone Phone { get ; set ; }
9+ }
10+
11+ public class CustomerPhone
12+ {
13+ public int Id { get ; set ; }
14+ public string PhoneNumber { get ; set ; }
15+ public Customer Customer { get ; set ; }
16+ }
17+
18+ public class CustomerAddress
19+ {
20+ public int Id { get ; set ; }
21+ public string Street { get ; set ; }
22+ public string City { get ; set ; }
23+ public string State { get ; set ; }
24+ public Customer Customer { get ; set ; }
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ namespace DotNetToolkit . Repository . Test
2+ {
3+ using Data ;
4+ using FetchStrategies ;
5+ using Xunit ;
6+
7+ public class FetchStrategyTests
8+ {
9+ [ Fact ]
10+ public void Include ( )
11+ {
12+ var strategy = new FetchStrategy < Customer > ( )
13+ . Include ( x => x . Address )
14+ . Include ( x => x . Phone )
15+ . Include ( x => x . Phone . Customer ) ;
16+
17+ Assert . Contains ( "Address" , strategy . IncludePaths ) ;
18+ Assert . Contains ( "Phone" , strategy . IncludePaths ) ;
19+ Assert . Contains ( "Phone.Customer" , strategy . IncludePaths ) ;
20+ }
21+
22+ [ Fact ]
23+ public void Include_Property_Names ( )
24+ {
25+ var strategy = new FetchStrategy < Customer > ( )
26+ . Include ( "Address" )
27+ . Include ( "Phone" )
28+ . Include ( "Phone.Customer" ) ;
29+
30+ Assert . Contains ( "Address" , strategy . IncludePaths ) ;
31+ Assert . Contains ( "Phone" , strategy . IncludePaths ) ;
32+ Assert . Contains ( "Phone.Customer" , strategy . IncludePaths ) ;
33+ }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments