You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-8Lines changed: 32 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,8 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
38
38
*[Getting started](#getting-started)
39
39
*[Examples](#examples)
40
40
*[Writing rules](#writing-rules)
41
-
*[Dependency search](#dependency-search)
41
+
*[Rules for dependency analysis](#rules-for-dependency-analysis)
42
+
*[Rules for assessing design and architectural principles](#rules-for-assessing-design-and-architectural-principles)
42
43
*[Slices](#slices)
43
44
*[Custom rules](#custom-rules)
44
45
*[Options](#options)
@@ -128,7 +129,7 @@ public class SampleApp_ModuleOmega_Tests
128
129
129
130
The fluent API should direct you in building up a rule, based on a combination of [predicates](documentation/api.md#predicate), [conditions](documentation/api.md#condition) and conjunctions.
130
131
131
-
The starting point for any rule is the static [`Types`](documentation/api.md#types) class, where you load a set of types from a assembly, domain or patth.
132
+
The starting point for any rule is the static [`Types`](documentation/api.md#types) class, where you load a set of types from an assembly, domain or path.
Finally, you obtain a result from the rule by using an executor, i.e. use `GetTypes()` to return the types that match the rule or `GetResult()` to determine whether the rule has been met.
145
146
146
147
Note that `GetResult()` returns [`TestResult`](documentation/api.md#testresult) which contains a few lists of types:
147
-
-`LoadedTypes` - all types loded by `Types`
148
-
-`SelectedTypesForTesting` - types that passed predicates
149
-
-`FailingTypes`- types that failed to meet the conditions
148
+
-`LoadedTypes` - all types loded by [`Types`](documentation/api.md#types)
149
+
-`SelectedTypesForTesting` - types that passed [predicates](documentation/api.md#predicate)
150
+
-`FailingTypes`- types that failed to meet the [conditions](documentation/api.md#condition)
@@ -155,7 +156,7 @@ var types = result.FailingTypes;
155
156
```
156
157
157
158
158
-
## Dependency search
159
+
## Rules for dependency analysis
159
160
160
161
Dependency matrix:
161
162
@@ -171,7 +172,7 @@ Dependency matrix:
171
172
| h | x | x | x |
172
173
173
174
174
-
Available rules:
175
+
#### Dependency search:
175
176
176
177
|| Rule | number<br> of required<br> dependencies <br>from the list | type can have<br>a dependency<br>that is not<br>on the list | passing types | failing types |
177
178
|---|---|---|---|---|---|
@@ -185,13 +186,36 @@ Available rules:
185
186
Explnation why a type fails dependecy search test is available on the failing type: [IType.Explanation](documentation/api.md#itypeexplanation)
186
187
187
188
188
-
### Reverse dependency search
189
+
####Reverse dependency search
189
190
190
191
|| Predicate | number<br> of required<br> dependencies <br>from the list | type can use<br>a type<br>that is not<br>on the list | passing types | failing types |
191
192
|---|---|---|---|---|---|
192
193
| R1 |[AreUsedByAny(c, d)](documentation/api.md#predicateareusedbyany)| at least 1 | yes | D2, D3 | D1 |
## Rules for assessing design and architectural principles
198
+
199
+
#### BeImmutable
200
+
201
+
A Type is considered as immutable when all its state (instance and static, fields, properties and events) cannot be changed after creation. Shallow immutability.
202
+
203
+
#### BeImmutableExternally
204
+
205
+
A Type is considered as externally immutable when its state (instance and static, fields, properties and events) with a public access modifier cannot be changed from the outside of the type. Shallow immutability.
206
+
207
+
#### BeStateless
208
+
209
+
A Type is considered as stateless when it does not have an instance state (fields, properties and events).
Copy file name to clipboardExpand all lines: documentation/readme.nt
+32-8Lines changed: 32 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
41
41
* [Getting started](#getting-started)
42
42
* [Examples](#examples)
43
43
* [Writing rules](#writing-rules)
44
-
* [Dependency search](#dependency-search)
44
+
* [Rules for dependency analysis](#rules-for-dependency-analysis)
45
+
* [Rules for assessing design and architectural principles](#rules-for-assessing-design-and-architectural-principles)
45
46
* [Slices](#slices)
46
47
* [Custom rules](#custom-rules)
47
48
* [Options](#options)
@@ -79,7 +80,7 @@ The library is available as a package on NuGet: [NetArchTest.eNhancedEdition](ht
79
80
80
81
The fluent API should direct you in building up a rule, based on a combination of [predicates](documentation/api.md#predicate), [conditions](documentation/api.md#condition) and conjunctions.
81
82
82
-
The starting point for any rule is the static [`Types`](documentation/api.md#types) class, where you load a set of types from a assembly, domain or patth.
83
+
The starting point for any rule is the static [`Types`](documentation/api.md#types) class, where you load a set of types from an assembly, domain or path.
83
84
84
85
```csharp
85
86
var types = Types.InAssembly(typeof(MyClass).Assembly);
Finally, you obtain a result from the rule by using an executor, i.e. use `GetTypes()` to return the types that match the rule or `GetResult()` to determine whether the rule has been met.
96
97
97
98
Note that `GetResult()` returns [`TestResult`](documentation/api.md#testresult) which contains a few lists of types:
98
-
- `LoadedTypes` - all types loded by `Types`
99
-
- `SelectedTypesForTesting` - types that passed predicates
100
-
- `FailingTypes`- types that failed to meet the conditions
99
+
- `LoadedTypes` - all types loded by [`Types`](documentation/api.md#types)
100
+
- `SelectedTypesForTesting` - types that passed [predicates](documentation/api.md#predicate)
101
+
- `FailingTypes`- types that failed to meet the [conditions](documentation/api.md#condition)
101
102
102
103
```csharp
103
104
var result = types.That().ResideInNamespace("MyProject.Data").Should().BeSealed().GetResult();
@@ -106,7 +107,7 @@ var types = result.FailingTypes;
106
107
```
107
108
108
109
109
-
## Dependency search
110
+
## Rules for dependency analysis
110
111
111
112
Dependency matrix:
112
113
@@ -122,7 +123,7 @@ Dependency matrix:
122
123
| h | x | x | x |
123
124
124
125
125
-
Available rules:
126
+
#### Dependency search:
126
127
127
128
| | Rule | number<br> of required<br> dependencies <br>from the list | type can have<br>a dependency<br>that is not<br>on the list | passing types | failing types |
128
129
|---|---|---|---|---|---|
@@ -136,13 +137,36 @@ Available rules:
136
137
Explnation why a type fails dependecy search test is available on the failing type: [IType.Explanation](documentation/api.md#itypeexplanation)
137
138
138
139
139
-
### Reverse dependency search
140
+
#### Reverse dependency search
140
141
141
142
| | Predicate | number<br> of required<br> dependencies <br>from the list | type can use<br>a type<br>that is not<br>on the list | passing types | failing types |
142
143
|---|---|---|---|---|---|
143
144
| R1 | [AreUsedByAny(c, d)](documentation/api.md#predicateareusedbyany) | at least 1 | yes | D2, D3 | D1 |
## Rules for assessing design and architectural principles
149
+
150
+
#### BeImmutable
151
+
152
+
A Type is considered as immutable when all its state (instance and static, fields, properties and events) cannot be changed after creation. Shallow immutability.
153
+
154
+
#### BeImmutableExternally
155
+
156
+
A Type is considered as externally immutable when its state (instance and static, fields, properties and events) with a public access modifier cannot be changed from the outside of the type. Shallow immutability.
157
+
158
+
#### BeStateless
159
+
160
+
A Type is considered as stateless when it does not have an instance state (fields, properties and events).
0 commit comments