Skip to content

Commit

Permalink
v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NeVeSpl committed Dec 6, 2023
1 parent 35d3bb2 commit c5d8255
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 11 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
- BenMorris/NetArchTest#131 - added rules for all access modifiers: public, internal, private, protected, private protected, protected internal
- BenMorris/NetArchTest#133 - added rules: AreInheritedByAnyType, AreNotInheritedByAnyType
- added rules : AreUsedByAny, AreNotUsedByAny
- at the end, you get more information which should make reasoning about tests easier:


![revit-database-scripting-update-query](documentation/result.printscreen.png)



## Index

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

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

#### BeStaticless

A Type is considered as stateless when it does not have a static state.

#### HaveParameterlessConstructor

A type should have a parameterless instance constructor.

#### DoNotHavePublicConstructor

A type should not have any instance public constructors.

#### HaveSourceFileNameMatchingName

#### HaveSourceFilePathMatchingNamespace
Expand Down
54 changes: 51 additions & 3 deletions documentation/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
* [DoNotHaveNameEndingWith](#PredicateDoNotHaveNameEndingWith)
* [DoNotHaveNameMatching](#PredicateDoNotHaveNameMatching)
* [DoNotHaveNameStartingWith](#PredicateDoNotHaveNameStartingWith)
* [DoNotHaveParameterlessConstructor](#PredicateDoNotHaveParameterlessConstructor)
* [DoNotHavePublicConstructor](#PredicateDoNotHavePublicConstructor)
* [DoNotImplementInterface](#PredicateDoNotImplementInterface)
* [DoNotImplementInterface<T>](#PredicateDoNotImplementInterface)
* [DoNotInherit](#PredicateDoNotInherit)
Expand All @@ -86,6 +88,8 @@
* [HaveNameEndingWith](#PredicateHaveNameEndingWith)
* [HaveNameMatching](#PredicateHaveNameMatching)
* [HaveNameStartingWith](#PredicateHaveNameStartingWith)
* [HaveParameterlessConstructor](#PredicateHaveParameterlessConstructor)
* [HavePublicConstructor](#PredicateHavePublicConstructor)
* [HaveSomeNonNullableMembers](#PredicateHaveSomeNonNullableMembers)
* [ImplementInterface](#PredicateImplementInterface)
* [ImplementInterface<T>](#PredicateImplementInterface)
Expand Down Expand Up @@ -147,6 +151,8 @@
* [HaveNameEndingWith](#ConditionHaveNameEndingWith)
* [HaveNameMatching](#ConditionHaveNameMatching)
* [HaveNameStartingWith](#ConditionHaveNameStartingWith)
* [HaveParameterlessConstructor](#ConditionHaveParameterlessConstructor)
* [HavePublicConstructor](#ConditionHavePublicConstructor)
* [HaveSomeNonNullableMembers](#ConditionHaveSomeNonNullableMembers)
* [HaveSourceFileNameMatchingName](#ConditionHaveSourceFileNameMatchingName)
* [HaveSourceFilePathMatchingNamespace](#ConditionHaveSourceFilePathMatchingNamespace)
Expand Down Expand Up @@ -184,6 +190,8 @@
* [NotHaveNameEndingWith](#ConditionNotHaveNameEndingWith)
* [NotHaveNameMatching](#ConditionNotHaveNameMatching)
* [NotHaveNameStartingWith](#ConditionNotHaveNameStartingWith)
* [NotHaveParameterlessConstructor](#ConditionNotHaveParameterlessConstructor)
* [NotHavePublicConstructor](#ConditionNotHavePublicConstructor)
* [NotImplementInterface](#ConditionNotImplementInterface)
* [NotImplementInterface<T>](#ConditionNotImplementInterface)
* [NotInherit](#ConditionNotInherit)
Expand Down Expand Up @@ -249,12 +257,12 @@ IEnumerable<IType> Types.GetTypes(Options options = null)
Returns the list of <see cref="T:System.Type"/> objects describing the types in this list.
### Types.InAssemblies
```csharp
Types Types.InAssemblies(IEnumerable<Assembly> assemblies, IEnumerable<string> searchDirectories = null)
Types Types.InAssemblies(IEnumerable<Assembly> assemblies, IEnumerable<string> searchDirectories = null, bool loadReferencedAssemblies = false)
```
Creates a list of types based on a list of assemblies.
### Types.InAssembly
```csharp
Types Types.InAssembly(Assembly assembly, IEnumerable<string> searchDirectories = null)
Types Types.InAssembly(Assembly assembly, IEnumerable<string> searchDirectories = null, bool loadReferencedAssemblies = false)
```
Creates a list of types based on a particular assembly.
### Types.InCurrentDomain
Expand Down Expand Up @@ -478,7 +486,7 @@ Selects types according that are marked as sealed.
```csharp
PredicateList Predicate.AreStateless()
```
Selects types that are stateless, they do not have instance state
Selects types that are stateless, they do not have instance state`
### Predicate.AreStatic
```csharp
PredicateList Predicate.AreStatic()
Expand Down Expand Up @@ -549,6 +557,16 @@ Selects types according to a regular expression that does not match their name.
PredicateList Predicate.DoNotHaveNameStartingWith(params string[] start)
```
Selects types whose names do not start with the specified text.
### Predicate.DoNotHaveParameterlessConstructor
```csharp
PredicateList Predicate.DoNotHaveParameterlessConstructor()
```
Selects types that do not have any instance parameterless constructors.
### Predicate.DoNotHavePublicConstructor
```csharp
PredicateList Predicate.DoNotHavePublicConstructor()
```
Selects types that do not have any instance public constructors.
### Predicate.DoNotImplementInterface
```csharp
PredicateList Predicate.DoNotImplementInterface(Type interfaceType)
Expand Down Expand Up @@ -644,6 +662,16 @@ Selects types according to a regular expression matching their name.
PredicateList Predicate.HaveNameStartingWith(params string[] start)
```
Selects types whose names start with the specified text.
### Predicate.HaveParameterlessConstructor
```csharp
PredicateList Predicate.HaveParameterlessConstructor()
```
Selects types that have at least one instance parameterless constructor.
### Predicate.HavePublicConstructor
```csharp
PredicateList Predicate.HavePublicConstructor()
```
Selects types that have at least one instance public constructor.
### Predicate.HaveSomeNonNullableMembers
```csharp
PredicateList Predicate.HaveSomeNonNullableMembers()
Expand Down Expand Up @@ -923,6 +951,16 @@ Selects types according to a regular expression matching their name.
ConditionList Condition.HaveNameStartingWith(string start)
```
Selects types whose names start with the specified text.
### Condition.HaveParameterlessConstructor
```csharp
ConditionList Condition.HaveParameterlessConstructor()
```
Selects types that have at least one instance parameterless constructor.
### Condition.HavePublicConstructor
```csharp
ConditionList Condition.HavePublicConstructor()
```
Selects types that have at least one instance public constructor.
### Condition.HaveSomeNonNullableMembers
```csharp
ConditionList Condition.HaveSomeNonNullableMembers()
Expand Down Expand Up @@ -1108,6 +1146,16 @@ Selects types according to a regular expression that does not match their name.
ConditionList Condition.NotHaveNameStartingWith(string start)
```
Selects types whose names do not start with the specified text.
### Condition.NotHaveParameterlessConstructor
```csharp
ConditionList Condition.NotHaveParameterlessConstructor()
```
Selects types that do not have any instance parameterless constructors.
### Condition.NotHavePublicConstructor
```csharp
ConditionList Condition.NotHavePublicConstructor()
```
Selects types that do not have any instance public constructors.
### Condition.NotImplementInterface
```csharp
ConditionList Condition.NotImplementInterface(Type interfaceType)
Expand Down
17 changes: 17 additions & 0 deletions documentation/readme.nt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ What **eNhancedEdition** has to offer, that is not available in the NetArchTest
- BenMorris/NetArchTest#131 - added rules for all access modifiers: public, internal, private, protected, private protected, protected internal
- BenMorris/NetArchTest#133 - added rules: AreInheritedByAnyType, AreNotInheritedByAnyType
- added rules : AreUsedByAny, AreNotUsedByAny
- at the end, you get more information which should make reasoning about tests easier:


![revit-database-scripting-update-query](documentation/result.printscreen.png)



## Index

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

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

#### BeStaticless

A Type is considered as stateless when it does not have a static state.

#### HaveParameterlessConstructor

A type should have a parameterless instance constructor.

#### DoNotHavePublicConstructor

A type should not have any instance public constructors.

#### HaveSourceFileNameMatchingName

#### HaveSourceFilePathMatchingNamespace
Expand Down
Binary file added documentation/result.printscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions sources/NetArchTest/Condition_Special.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public ConditionList HavePublicConstructor()
}

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

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

/// <summary>
/// Selects types that do not have a instance parameterless constructor.
/// Selects types that do not have any instance parameterless constructors.
/// </summary>
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
public ConditionList NotHaveParameterlessConstructor()
Expand Down
2 changes: 1 addition & 1 deletion sources/NetArchTest/NetArchTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Authors>NeVeSpl</Authors>
<Product>NetArchTest.eNhancedEdition </Product>
<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>
Expand Down
8 changes: 4 additions & 4 deletions sources/NetArchTest/Predicate_Special.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public PredicateList AreImmutableExternally()
}

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


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

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

/// <summary>
/// Selects types that do not have public instance parameterless constructor.
/// Selects types that do not have any instance parameterless constructors.
/// </summary>
/// <returns>An updated set of conditions that can be applied to a list of types.</returns>
public PredicateList DoNotHaveParameterlessConstructor()
Expand Down

0 comments on commit c5d8255

Please sign in to comment.