@@ -16,12 +16,12 @@ namespace NetArchTest.Rules
1616 /// </summary>
1717 public sealed class Types
1818 {
19- private readonly RuleContext rule ;
19+ private readonly IEnumerable < TypeSpec > types ;
2020
2121
2222 private Types ( IEnumerable < TypeSpec > types )
2323 {
24- rule = new RuleContext ( types ) ;
24+ this . types = types ;
2525 }
2626
2727
@@ -110,7 +110,7 @@ public static Types FromPath(string path, IEnumerable<string> searchDirectories
110110 /// <returns>A list of types onto which you can apply a series of filters.</returns>
111111 public Predicate That ( )
112112 {
113- return new Predicate ( rule ) ;
113+ return new Predicate ( new RuleContext ( types ) ) ;
114114 }
115115
116116 /// <summary>
@@ -119,7 +119,7 @@ public Predicate That()
119119 /// <returns></returns>
120120 public Condition Should ( )
121121 {
122- return new Condition ( rule , true ) ;
122+ return new Condition ( new RuleContext ( types ) , true ) ;
123123 }
124124
125125 /// <summary>
@@ -128,7 +128,7 @@ public Condition Should()
128128 /// <returns></returns>
129129 public Condition ShouldNot ( )
130130 {
131- return new Condition ( rule , false ) ;
131+ return new Condition ( new RuleContext ( types ) , false ) ;
132132 }
133133
134134 /// <summary>
@@ -137,7 +137,7 @@ public Condition ShouldNot()
137137 /// <returns></returns>
138138 public SlicePredicate Slice ( )
139139 {
140- return new SlicePredicate ( rule ) ;
140+ return new SlicePredicate ( new RuleContext ( types ) ) ;
141141 }
142142
143143
@@ -147,7 +147,7 @@ public SlicePredicate Slice()
147147 /// <returns>The list of <see cref="Type"/> objects in this list.</returns>
148148 public IEnumerable < IType > GetTypes ( )
149149 {
150- return rule . GetTypes ( ) ;
150+ return new RuleContext ( types ) . GetTypes ( ) ;
151151 }
152152 }
153153}
0 commit comments