Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ArchUnit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MethodMemberAssembly", "Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyMemberAssembly", "TestAssemblies\PropertyMemberAssembly\PropertyMemberAssembly.csproj", "{1D0187EB-9D04-4CF3-AE63-0C0E97FCB49C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassAssembly", "TestAssemblies\ClassAssembly\ClassAssembly.csproj", "{2C04EB93-5AE0-474C-B328-145A734A5E2B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -407,6 +409,18 @@ Global
{1D0187EB-9D04-4CF3-AE63-0C0E97FCB49C}.Release|x64.Build.0 = Release|Any CPU
{1D0187EB-9D04-4CF3-AE63-0C0E97FCB49C}.Release|x86.ActiveCfg = Release|Any CPU
{1D0187EB-9D04-4CF3-AE63-0C0E97FCB49C}.Release|x86.Build.0 = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|x64.ActiveCfg = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|x64.Build.0 = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|x86.ActiveCfg = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Debug|x86.Build.0 = Debug|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|Any CPU.Build.0 = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|x64.ActiveCfg = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|x64.Build.0 = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|x86.ActiveCfg = Release|Any CPU
{2C04EB93-5AE0-474C-B328-145A734A5E2B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -423,5 +437,6 @@ Global
{ABCA0EC3-E47E-453E-B4CC-3446ED4F7643} = {B1191F18-91CB-4387-B775-A5EB64D3AC30}
{05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088} = {B1191F18-91CB-4387-B775-A5EB64D3AC30}
{1D0187EB-9D04-4CF3-AE63-0C0E97FCB49C} = {B1191F18-91CB-4387-B775-A5EB64D3AC30}
{2C04EB93-5AE0-474C-B328-145A734A5E2B} = {B1191F18-91CB-4387-B775-A5EB64D3AC30}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ public interface IAddClassCondition<TNextElement, TRuleType>
{
TNextElement BeAbstract();
TNextElement BeSealed();
TNextElement BeRecord();
TNextElement BeImmutable();

//Negations

TNextElement NotBeAbstract();
TNextElement NotBeSealed();
TNextElement NotBeRecord();
TNextElement NotBeImmutable();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ public interface IAddClassPredicate<out TNextElement, TRuleType>
{
TNextElement AreAbstract();
TNextElement AreSealed();
TNextElement AreRecord();
TNextElement AreImmutable();

//Negations

TNextElement AreNotAbstract();
TNextElement AreNotSealed();
TNextElement AreNotRecord();
TNextElement AreNotImmutable();
}
}
1 change: 1 addition & 0 deletions ArchUnitNETTests/ArchUnitNETTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<ProjectReference Include="..\TestAssemblies\TypeAssembly\TypeAssembly.csproj" />
<ProjectReference Include="..\TestAssemblies\MethodMemberAssembly\MethodMemberAssembly.csproj" />
<ProjectReference Include="..\TestAssemblies\PropertyMemberAssembly\PropertyMemberAssembly.csproj" />
<ProjectReference Include="..\TestAssemblies\ClassAssembly\ClassAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
Expand Down
73 changes: 73 additions & 0 deletions ArchUnitNETTests/AssemblyTestHelper/ClassAssemblyTestHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System;
using ArchUnitNET.Domain;
using ArchUnitNET.Domain.Extensions;
using ClassNamespace;

namespace ArchUnitNETTests.AssemblyTestHelper;

public class ClassAssemblyTestHelper : AssemblyTestHelper
{
public sealed override Architecture Architecture => StaticTestArchitectures.ClassArchitecture;

public Class RegularClass;
public Type RegularClassSystemType = typeof(RegularClass);

public Class OtherRegularClass;
public Type OtherRegularClassSystemType = typeof(OtherRegularClass);

public Class AbstractClass;
public Type AbstractClassSystemType = typeof(AbstractClass);

public Class OtherAbstractClass;
public Type OtherAbstractClassSystemType = typeof(OtherAbstractClass);

public Class SealedClass;
public Type SealedClassSystemType = typeof(SealedClass);

public Class OtherSealedClass;
public Type OtherSealedClassSystemType = typeof(OtherSealedClass);

public Class RecordClass;
public Type RecordClassSystemType = typeof(RecordClass);

public Class OtherRecordClass;
public Type OtherRecordClassSystemType = typeof(OtherRecordClass);

public Class ImmutableClass;
public Type ImmutableClassSystemType = typeof(ImmutableClass);

public Class OtherImmutableClass;
public Type OtherImmutableClassSystemType = typeof(OtherImmutableClass);

public Class MutableClass;
public Type MutableClassSystemType = typeof(MutableClass);

public Class OtherMutableClass;
public Type OtherMutableClassSystemType = typeof(OtherMutableClass);

public Class ClassWithoutMembers;
public Type ClassWithoutMembersSystemType = typeof(ClassWithoutMembers);

public Class ClassWithOnlyStaticMembers;
public Type ClassWithOnlyStaticMembersSystemType = typeof(ClassWithOnlyStaticMembers);

public ClassAssemblyTestHelper()
{
RegularClass = Architecture.GetClassOfType(typeof(RegularClass));
OtherRegularClass = Architecture.GetClassOfType(typeof(OtherRegularClass));
AbstractClass = Architecture.GetClassOfType(typeof(AbstractClass));
OtherAbstractClass = Architecture.GetClassOfType(typeof(OtherAbstractClass));
SealedClass = Architecture.GetClassOfType(typeof(SealedClass));
OtherSealedClass = Architecture.GetClassOfType(typeof(OtherSealedClass));
RecordClass = Architecture.GetClassOfType(typeof(RecordClass));
OtherRecordClass = Architecture.GetClassOfType(typeof(OtherRecordClass));
ImmutableClass = Architecture.GetClassOfType(typeof(ImmutableClass));
OtherImmutableClass = Architecture.GetClassOfType(typeof(OtherImmutableClass));
MutableClass = Architecture.GetClassOfType(typeof(MutableClass));
OtherMutableClass = Architecture.GetClassOfType(typeof(OtherMutableClass));
ClassWithoutMembers = Architecture.GetClassOfType(typeof(ClassWithoutMembers));
ClassWithOnlyStaticMembers = Architecture.GetClassOfType(
typeof(ClassWithOnlyStaticMembers)
);
}
}
Loading
Loading