@@ -49,8 +49,7 @@ public static Relationship CreateActiveRelationship(IdentityAddress? from = null
49
49
{
50
50
from ??= IDENTITY_1 ;
51
51
to ??= IDENTITY_2 ;
52
- var template = new RelationshipTemplate ( to , DEVICE_2 , 999 , null , [ ] ) ;
53
- var relationship = new Relationship ( template , from , DEVICE_1 , [ ] , [ ] ) ;
52
+ var relationship = CreatePendingRelationship ( from , to ) ;
54
53
relationship . Accept ( to , DEVICE_2 , [ ] ) ;
55
54
relationship . ClearDomainEvents ( ) ;
56
55
return relationship ;
@@ -60,8 +59,7 @@ public static Relationship CreateRejectedRelationship(IdentityAddress? from = nu
60
59
{
61
60
from ??= IDENTITY_1 ;
62
61
to ??= IDENTITY_2 ;
63
- var template = new RelationshipTemplate ( to , DEVICE_2 , 999 , null , [ ] ) ;
64
- var relationship = new Relationship ( template , from , DEVICE_1 , [ ] , [ ] ) ;
62
+ var relationship = CreatePendingRelationship ( from , to ) ;
65
63
relationship . Reject ( to , DEVICE_2 , null ) ;
66
64
relationship . ClearDomainEvents ( ) ;
67
65
return relationship ;
@@ -71,8 +69,7 @@ public static Relationship CreateRevokedRelationship(IdentityAddress? from = nul
71
69
{
72
70
from ??= IDENTITY_1 ;
73
71
to ??= IDENTITY_2 ;
74
- var template = new RelationshipTemplate ( to , DEVICE_2 , 999 , null , [ ] ) ;
75
- var relationship = new Relationship ( template , from , DEVICE_1 , [ ] , [ ] ) ;
72
+ var relationship = CreatePendingRelationship ( from , to ) ;
76
73
relationship . Revoke ( from , DEVICE_2 , null ) ;
77
74
relationship . ClearDomainEvents ( ) ;
78
75
return relationship ;
0 commit comments