Skip to content

Commit c5d8255

Browse files
committed
v1.4.1
1 parent 35d3bb2 commit c5d8255

File tree

7 files changed

+93
-11
lines changed

7 files changed

+93
-11
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
3131
- BenMorris/NetArchTest#131 - added rules for all access modifiers: public, internal, private, protected, private protected, protected internal
3232
- BenMorris/NetArchTest#133 - added rules: AreInheritedByAnyType, AreNotInheritedByAnyType
3333
- added rules : AreUsedByAny, AreNotUsedByAny
34+
- at the end, you get more information which should make reasoning about tests easier:
3435

3536

37+
![revit-database-scripting-update-query](documentation/result.printscreen.png)
38+
39+
40+
3641
## Index
3742

3843
* [Getting started](#getting-started)
@@ -210,6 +215,18 @@ A Type is considered as externally immutable when its state (instance and static
210215

211216
A Type is considered as stateless when it does not have an instance state (fields, properties and events).
212217

218+
#### BeStaticless
219+
220+
A Type is considered as stateless when it does not have a static state.
221+
222+
#### HaveParameterlessConstructor
223+
224+
A type should have a parameterless instance constructor.
225+
226+
#### DoNotHavePublicConstructor
227+
228+
A type should not have any instance public constructors.
229+
213230
#### HaveSourceFileNameMatchingName
214231

215232
#### HaveSourceFilePathMatchingNamespace

documentation/api.md

+51-3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
* [DoNotHaveNameEndingWith](#PredicateDoNotHaveNameEndingWith)
6868
* [DoNotHaveNameMatching](#PredicateDoNotHaveNameMatching)
6969
* [DoNotHaveNameStartingWith](#PredicateDoNotHaveNameStartingWith)
70+
* [DoNotHaveParameterlessConstructor](#PredicateDoNotHaveParameterlessConstructor)
71+
* [DoNotHavePublicConstructor](#PredicateDoNotHavePublicConstructor)
7072
* [DoNotImplementInterface](#PredicateDoNotImplementInterface)
7173
* [DoNotImplementInterface<T>](#PredicateDoNotImplementInterface)
7274
* [DoNotInherit](#PredicateDoNotInherit)
@@ -86,6 +88,8 @@
8688
* [HaveNameEndingWith](#PredicateHaveNameEndingWith)
8789
* [HaveNameMatching](#PredicateHaveNameMatching)
8890
* [HaveNameStartingWith](#PredicateHaveNameStartingWith)
91+
* [HaveParameterlessConstructor](#PredicateHaveParameterlessConstructor)
92+
* [HavePublicConstructor](#PredicateHavePublicConstructor)
8993
* [HaveSomeNonNullableMembers](#PredicateHaveSomeNonNullableMembers)
9094
* [ImplementInterface](#PredicateImplementInterface)
9195
* [ImplementInterface<T>](#PredicateImplementInterface)
@@ -147,6 +151,8 @@
147151
* [HaveNameEndingWith](#ConditionHaveNameEndingWith)
148152
* [HaveNameMatching](#ConditionHaveNameMatching)
149153
* [HaveNameStartingWith](#ConditionHaveNameStartingWith)
154+
* [HaveParameterlessConstructor](#ConditionHaveParameterlessConstructor)
155+
* [HavePublicConstructor](#ConditionHavePublicConstructor)
150156
* [HaveSomeNonNullableMembers](#ConditionHaveSomeNonNullableMembers)
151157
* [HaveSourceFileNameMatchingName](#ConditionHaveSourceFileNameMatchingName)
152158
* [HaveSourceFilePathMatchingNamespace](#ConditionHaveSourceFilePathMatchingNamespace)
@@ -184,6 +190,8 @@
184190
* [NotHaveNameEndingWith](#ConditionNotHaveNameEndingWith)
185191
* [NotHaveNameMatching](#ConditionNotHaveNameMatching)
186192
* [NotHaveNameStartingWith](#ConditionNotHaveNameStartingWith)
193+
* [NotHaveParameterlessConstructor](#ConditionNotHaveParameterlessConstructor)
194+
* [NotHavePublicConstructor](#ConditionNotHavePublicConstructor)
187195
* [NotImplementInterface](#ConditionNotImplementInterface)
188196
* [NotImplementInterface<T>](#ConditionNotImplementInterface)
189197
* [NotInherit](#ConditionNotInherit)
@@ -249,12 +257,12 @@ IEnumerable<IType> Types.GetTypes(Options options = null)
249257
Returns the list of <see cref="T:System.Type"/> objects describing the types in this list.
250258
### Types.InAssemblies
251259
```csharp
252-
Types Types.InAssemblies(IEnumerable<Assembly> assemblies, IEnumerable<string> searchDirectories = null)
260+
Types Types.InAssemblies(IEnumerable<Assembly> assemblies, IEnumerable<string> searchDirectories = null, bool loadReferencedAssemblies = false)
253261
```
254262
Creates a list of types based on a list of assemblies.
255263
### Types.InAssembly
256264
```csharp
257-
Types Types.InAssembly(Assembly assembly, IEnumerable<string> searchDirectories = null)
265+
Types Types.InAssembly(Assembly assembly, IEnumerable<string> searchDirectories = null, bool loadReferencedAssemblies = false)
258266
```
259267
Creates a list of types based on a particular assembly.
260268
### Types.InCurrentDomain
@@ -478,7 +486,7 @@ Selects types according that are marked as sealed.
478486
```csharp
479487
PredicateList Predicate.AreStateless()
480488
```
481-
Selects types that are stateless, they do not have instance state
489+
Selects types that are stateless, they do not have instance state`
482490
### Predicate.AreStatic
483491
```csharp
484492
PredicateList Predicate.AreStatic()
@@ -549,6 +557,16 @@ Selects types according to a regular expression that does not match their name.
549557
PredicateList Predicate.DoNotHaveNameStartingWith(params string[] start)
550558
```
551559
Selects types whose names do not start with the specified text.
560+
### Predicate.DoNotHaveParameterlessConstructor
561+
```csharp
562+
PredicateList Predicate.DoNotHaveParameterlessConstructor()
563+
```
564+
Selects types that do not have any instance parameterless constructors.
565+
### Predicate.DoNotHavePublicConstructor
566+
```csharp
567+
PredicateList Predicate.DoNotHavePublicConstructor()
568+
```
569+
Selects types that do not have any instance public constructors.
552570
### Predicate.DoNotImplementInterface
553571
```csharp
554572
PredicateList Predicate.DoNotImplementInterface(Type interfaceType)
@@ -644,6 +662,16 @@ Selects types according to a regular expression matching their name.
644662
PredicateList Predicate.HaveNameStartingWith(params string[] start)
645663
```
646664
Selects types whose names start with the specified text.
665+
### Predicate.HaveParameterlessConstructor
666+
```csharp
667+
PredicateList Predicate.HaveParameterlessConstructor()
668+
```
669+
Selects types that have at least one instance parameterless constructor.
670+
### Predicate.HavePublicConstructor
671+
```csharp
672+
PredicateList Predicate.HavePublicConstructor()
673+
```
674+
Selects types that have at least one instance public constructor.
647675
### Predicate.HaveSomeNonNullableMembers
648676
```csharp
649677
PredicateList Predicate.HaveSomeNonNullableMembers()
@@ -923,6 +951,16 @@ Selects types according to a regular expression matching their name.
923951
ConditionList Condition.HaveNameStartingWith(string start)
924952
```
925953
Selects types whose names start with the specified text.
954+
### Condition.HaveParameterlessConstructor
955+
```csharp
956+
ConditionList Condition.HaveParameterlessConstructor()
957+
```
958+
Selects types that have at least one instance parameterless constructor.
959+
### Condition.HavePublicConstructor
960+
```csharp
961+
ConditionList Condition.HavePublicConstructor()
962+
```
963+
Selects types that have at least one instance public constructor.
926964
### Condition.HaveSomeNonNullableMembers
927965
```csharp
928966
ConditionList Condition.HaveSomeNonNullableMembers()
@@ -1108,6 +1146,16 @@ Selects types according to a regular expression that does not match their name.
11081146
ConditionList Condition.NotHaveNameStartingWith(string start)
11091147
```
11101148
Selects types whose names do not start with the specified text.
1149+
### Condition.NotHaveParameterlessConstructor
1150+
```csharp
1151+
ConditionList Condition.NotHaveParameterlessConstructor()
1152+
```
1153+
Selects types that do not have any instance parameterless constructors.
1154+
### Condition.NotHavePublicConstructor
1155+
```csharp
1156+
ConditionList Condition.NotHavePublicConstructor()
1157+
```
1158+
Selects types that do not have any instance public constructors.
11111159
### Condition.NotImplementInterface
11121160
```csharp
11131161
ConditionList Condition.NotImplementInterface(Type interfaceType)

documentation/readme.nt

+17
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
3434
- BenMorris/NetArchTest#131 - added rules for all access modifiers: public, internal, private, protected, private protected, protected internal
3535
- BenMorris/NetArchTest#133 - added rules: AreInheritedByAnyType, AreNotInheritedByAnyType
3636
- added rules : AreUsedByAny, AreNotUsedByAny
37+
- at the end, you get more information which should make reasoning about tests easier:
3738

3839

40+
![revit-database-scripting-update-query](documentation/result.printscreen.png)
41+
42+
43+
3944
## Index
4045

4146
* [Getting started](#getting-started)
@@ -161,6 +166,18 @@ A Type is considered as externally immutable when its state (instance and static
161166

162167
A Type is considered as stateless when it does not have an instance state (fields, properties and events).
163168

169+
#### BeStaticless
170+
171+
A Type is considered as stateless when it does not have a static state.
172+
173+
#### HaveParameterlessConstructor
174+
175+
A type should have a parameterless instance constructor.
176+
177+
#### DoNotHavePublicConstructor
178+
179+
A type should not have any instance public constructors.
180+
164181
#### HaveSourceFileNameMatchingName
165182

166183
#### HaveSourceFilePathMatchingNamespace

documentation/result.printscreen.png

44.8 KB
Loading

sources/NetArchTest/Condition_Special.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public ConditionList HavePublicConstructor()
136136
}
137137

138138
/// <summary>
139-
/// Selects types that do not have a instance public constructor.
139+
/// Selects types that do not have any instance public constructors.
140140
/// </summary>
141141
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
142142
public ConditionList NotHavePublicConstructor()
@@ -146,7 +146,7 @@ public ConditionList NotHavePublicConstructor()
146146
}
147147

148148
/// <summary>
149-
/// Selects types that have at least one instance parameterless constructor.
149+
/// Selects types that have at least one instance parameterless constructor.
150150
/// </summary>
151151
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
152152
public ConditionList HaveParameterlessConstructor()
@@ -156,7 +156,7 @@ public ConditionList HaveParameterlessConstructor()
156156
}
157157

158158
/// <summary>
159-
/// Selects types that do not have a instance parameterless constructor.
159+
/// Selects types that do not have any instance parameterless constructors.
160160
/// </summary>
161161
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
162162
public ConditionList NotHaveParameterlessConstructor()

sources/NetArchTest/NetArchTest.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>1.4.0</Version>
5+
<Version>1.4.1</Version>
66
<Authors>NeVeSpl</Authors>
77
<Product>NetArchTest.eNhancedEdition </Product>
88
<Description>A fluent API for .Net Standard that can enforce architectural rules in unit tests. Improved version, built upon NetArchTest.Rules v1.3.2.</Description>

sources/NetArchTest/Predicate_Special.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public PredicateList AreImmutableExternally()
3535
}
3636

3737
/// <summary>
38-
/// Selects types that are stateless, they do not have instance state
38+
/// Selects types that are stateless, they do not have instance state`
3939
/// </summary>
4040
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
4141
public PredicateList AreStateless()
@@ -86,7 +86,7 @@ public PredicateList OnlyHaveNonNullableMembers()
8686

8787

8888
/// <summary>
89-
/// Selects types that have at least one public instance constructor.
89+
/// Selects types that have at least one instance public constructor.
9090
/// </summary>
9191
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
9292
public PredicateList HavePublicConstructor()
@@ -96,7 +96,7 @@ public PredicateList HavePublicConstructor()
9696
}
9797

9898
/// <summary>
99-
/// Selects types that do not have public instance constructor.
99+
/// Selects types that do not have any instance public constructors.
100100
/// </summary>
101101
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
102102
public PredicateList DoNotHavePublicConstructor()
@@ -117,7 +117,7 @@ public PredicateList HaveParameterlessConstructor()
117117
}
118118

119119
/// <summary>
120-
/// Selects types that do not have public instance parameterless constructor.
120+
/// Selects types that do not have any instance parameterless constructors.
121121
/// </summary>
122122
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
123123
public PredicateList DoNotHaveParameterlessConstructor()

0 commit comments

Comments
 (0)