Skip to content

Commit 60e7aa4

Browse files
chore: format code with csharpier
Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
1 parent 41b3b08 commit 60e7aa4

469 files changed

Lines changed: 23191 additions & 10269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ArchUnitNET.MSTestV2/ArchRuleAssert.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -26,4 +26,4 @@ public static void FulfilsRule(Architecture architecture, IArchRule archRule)
2626
}
2727
}
2828
}
29-
}
29+
}

ArchUnitNET.MSTestV2/ArchRuleExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -31,4 +31,4 @@ public static void CheckRule(this Architecture architecture, IArchRule archRule)
3131
ArchRuleAssert.FulfilsRule(architecture, archRule);
3232
}
3333
}
34-
}
34+
}

ArchUnitNET.MSTestV2Tests/RuleEvaluationTests.cs

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -25,7 +25,9 @@ public class RuleEvaluationTests
2525
[ClassInitialize]
2626
public static void Setup(TestContext context)
2727
{
28-
_architecture = new ArchLoader().LoadAssemblies(System.Reflection.Assembly.Load("ArchUnitNET.MSTestV2Tests")).Build();
28+
_architecture = new ArchLoader()
29+
.LoadAssemblies(System.Reflection.Assembly.Load("ArchUnitNET.MSTestV2Tests"))
30+
.Build();
2931
_trueRule = Classes().That().Are(typeof(RuleEvaluationTests)).Should().Exist();
3032
_falseRule = Classes().That().Are(typeof(RuleEvaluationTests)).Should().NotExist();
3133
_expectedErrorMessage = _falseRule.Evaluate(_architecture).ToErrorMessage();
@@ -35,26 +37,55 @@ public static void Setup(TestContext context)
3537
public void ArchRuleAssertTest()
3638
{
3739
ArchRuleAssert.FulfilsRule(_architecture, _trueRule);
38-
Assert.ThrowsException<AssertFailedException>(() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule));
39-
Assert.AreEqual(_expectedErrorMessage,
40-
RemoveAssertionText(Assert.ThrowsException<AssertFailedException>(() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)).Message));
40+
Assert.ThrowsException<AssertFailedException>(
41+
() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)
42+
);
43+
Assert.AreEqual(
44+
_expectedErrorMessage,
45+
RemoveAssertionText(
46+
Assert
47+
.ThrowsException<AssertFailedException>(
48+
() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)
49+
)
50+
.Message
51+
)
52+
);
4153
}
4254

4355
[TestMethod]
4456
public void ArchRuleExtensionsTest()
4557
{
4658
_architecture.CheckRule(_trueRule);
4759
_trueRule.Check(_architecture);
48-
Assert.ThrowsException<AssertFailedException>(() => _architecture.CheckRule(_falseRule));
60+
Assert.ThrowsException<AssertFailedException>(
61+
() => _architecture.CheckRule(_falseRule)
62+
);
4963
Assert.ThrowsException<AssertFailedException>(() => _falseRule.Check(_architecture));
50-
Assert.AreEqual(_expectedErrorMessage,
51-
RemoveAssertionText(Assert.ThrowsException<AssertFailedException>(() => _architecture.CheckRule(_falseRule)).Message));
52-
Assert.AreEqual(_expectedErrorMessage,
53-
RemoveAssertionText(Assert.ThrowsException<AssertFailedException>(() => _falseRule.Check(_architecture)).Message));
64+
Assert.AreEqual(
65+
_expectedErrorMessage,
66+
RemoveAssertionText(
67+
Assert
68+
.ThrowsException<AssertFailedException>(
69+
() => _architecture.CheckRule(_falseRule)
70+
)
71+
.Message
72+
)
73+
);
74+
Assert.AreEqual(
75+
_expectedErrorMessage,
76+
RemoveAssertionText(
77+
Assert
78+
.ThrowsException<AssertFailedException>(
79+
() => _falseRule.Check(_architecture)
80+
)
81+
.Message
82+
)
83+
);
5484
}
5585

56-
private static string RemoveAssertionText(string exceptionMessage) {
57-
return exceptionMessage.Replace("Assert.Fail failed. ", string.Empty);
86+
private static string RemoveAssertionText(string exceptionMessage)
87+
{
88+
return exceptionMessage.Replace("Assert.Fail failed. ", string.Empty);
5889
}
5990
}
60-
}
91+
}

ArchUnitNET.NUnit/ArchRuleAssert.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -26,4 +26,4 @@ public static void FulfilsRule(Architecture architecture, IArchRule archRule)
2626
}
2727
}
2828
}
29-
}
29+
}

ArchUnitNET.NUnit/ArchRuleExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -31,4 +31,4 @@ public static void CheckRule(this Architecture architecture, IArchRule archRule)
3131
ArchRuleAssert.FulfilsRule(architecture, archRule);
3232
}
3333
}
34-
}
34+
}

ArchUnitNET.NUnitTests/RuleEvaluationTests.cs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -24,7 +24,9 @@ public class RuleEvaluationTests
2424
[SetUp]
2525
public void Setup()
2626
{
27-
_architecture = new ArchLoader().LoadAssemblies(System.Reflection.Assembly.Load("ArchUnitNET.NUnitTests")).Build();
27+
_architecture = new ArchLoader()
28+
.LoadAssemblies(System.Reflection.Assembly.Load("ArchUnitNET.NUnitTests"))
29+
.Build();
2830
_trueRule = Classes().That().Are(typeof(RuleEvaluationTests)).Should().Exist();
2931
_falseRule = Classes().That().Are(typeof(RuleEvaluationTests)).Should().NotExist();
3032
_expectedErrorMessage = _falseRule.Evaluate(_architecture).ToErrorMessage();
@@ -34,9 +36,17 @@ public void Setup()
3436
public void ArchRuleAssertTest()
3537
{
3638
ArchRuleAssert.FulfilsRule(_architecture, _trueRule);
37-
Assert.Throws<AssertionException>(() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule));
38-
Assert.AreEqual(_expectedErrorMessage,
39-
Assert.Catch<AssertionException>(() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)).Message);
39+
Assert.Throws<AssertionException>(
40+
() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)
41+
);
42+
Assert.AreEqual(
43+
_expectedErrorMessage,
44+
Assert
45+
.Catch<AssertionException>(
46+
() => ArchRuleAssert.FulfilsRule(_architecture, _falseRule)
47+
)
48+
.Message
49+
);
4050
}
4151

4252
[Test]
@@ -46,10 +56,14 @@ public void ArchRuleExtensionsTest()
4656
_trueRule.Check(_architecture);
4757
Assert.Throws<AssertionException>(() => _architecture.CheckRule(_falseRule));
4858
Assert.Throws<AssertionException>(() => _falseRule.Check(_architecture));
49-
Assert.AreEqual(_expectedErrorMessage,
50-
Assert.Catch<AssertionException>(() => _architecture.CheckRule(_falseRule)).Message);
51-
Assert.AreEqual(_expectedErrorMessage,
52-
Assert.Catch<AssertionException>(() => _falseRule.Check(_architecture)).Message);
59+
Assert.AreEqual(
60+
_expectedErrorMessage,
61+
Assert.Catch<AssertionException>(() => _architecture.CheckRule(_falseRule)).Message
62+
);
63+
Assert.AreEqual(
64+
_expectedErrorMessage,
65+
Assert.Catch<AssertionException>(() => _falseRule.Check(_architecture)).Message
66+
);
5367
}
5468
}
55-
}
69+
}

ArchUnitNET.xUnit/ArchRuleAssert.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -26,4 +26,4 @@ public static void CheckRule(Architecture architecture, IArchRule archRule)
2626
}
2727
}
2828
}
29-
}
29+
}

ArchUnitNET.xUnit/ArchRuleExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using ArchUnitNET.Domain;
@@ -32,4 +32,4 @@ public static void CheckRule(this Architecture architecture, IArchRule archRule)
3232
ArchRuleAssert.CheckRule(architecture, archRule);
3333
}
3434
}
35-
}
35+
}

ArchUnitNET.xUnit/FailedArchRuleException.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using System.Collections.Generic;
@@ -21,17 +21,13 @@ public class FailedArchRuleException : XunitException
2121
/// <param name="architecture">The architecture which was tested</param>
2222
/// <param name="archRule">The archrule that failed</param>
2323
public FailedArchRuleException(Architecture architecture, IArchRule archRule)
24-
: this(archRule.Evaluate(architecture))
25-
{
26-
}
24+
: this(archRule.Evaluate(architecture)) { }
2725

2826
/// <summary>
2927
/// Creates a new instance of the <see href="FailedArchRuleException" /> class.
3028
/// </summary>
3129
/// <param name="evaluationResults">The results of the evaluation of the archrule</param>
3230
public FailedArchRuleException(IEnumerable<EvaluationResult> evaluationResults)
33-
: base(evaluationResults.ToErrorMessage())
34-
{
35-
}
31+
: base(evaluationResults.ToErrorMessage()) { }
3632
}
37-
}
33+
}

ArchUnitNET/Domain/Architecture.cs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Florian Gather <florian.gather@tngtech.com>
22
// Copyright 2019 Paula Ruiz <paularuiz22@gmail.com>
33
// Copyright 2019 Fritz Brandhuber <fritz.brandhuber@tngtech.com>
4-
//
4+
//
55
// SPDX-License-Identifier: Apache-2.0
66

77
using System;
@@ -15,9 +15,13 @@ public class Architecture
1515
private readonly IEnumerable<Assembly> _allAssemblies;
1616
private readonly ObjectProviderCache _objectProviderCache;
1717

18-
public Architecture(IEnumerable<Assembly> allAssemblies, IEnumerable<Namespace> namespaces,
19-
IEnumerable<IType> types, IEnumerable<GenericParameter> genericParameters,
20-
IEnumerable<IType> referencedTypes)
18+
public Architecture(
19+
IEnumerable<Assembly> allAssemblies,
20+
IEnumerable<Namespace> namespaces,
21+
IEnumerable<IType> types,
22+
IEnumerable<GenericParameter> genericParameters,
23+
IEnumerable<IType> referencedTypes
24+
)
2125
{
2226
_allAssemblies = allAssemblies;
2327
Namespaces = namespaces;
@@ -27,7 +31,8 @@ public Architecture(IEnumerable<Assembly> allAssemblies, IEnumerable<Namespace>
2731
_objectProviderCache = new ObjectProviderCache(this);
2832
}
2933

30-
public IEnumerable<Assembly> Assemblies => _allAssemblies.Where(assembly => !assembly.IsOnlyReferenced);
34+
public IEnumerable<Assembly> Assemblies =>
35+
_allAssemblies.Where(assembly => !assembly.IsOnlyReferenced);
3136
public IEnumerable<Namespace> Namespaces { get; }
3237
public IEnumerable<IType> Types { get; }
3338
public IEnumerable<GenericParameter> GenericParameters { get; }
@@ -45,8 +50,11 @@ public Architecture(IEnumerable<Assembly> allAssemblies, IEnumerable<Namespace>
4550
public IEnumerable<MethodMember> MethodMembers => Members.OfType<MethodMember>();
4651
public IEnumerable<IMember> Members => Types.SelectMany(type => type.Members);
4752

48-
public IEnumerable<T> GetOrCreateObjects<T>(IObjectProvider<T> objectProvider,
49-
Func<Architecture, IEnumerable<T>> providingFunction) where T : ICanBeAnalyzed
53+
public IEnumerable<T> GetOrCreateObjects<T>(
54+
IObjectProvider<T> objectProvider,
55+
Func<Architecture, IEnumerable<T>> providingFunction
56+
)
57+
where T : ICanBeAnalyzed
5058
{
5159
return _objectProviderCache.GetOrCreateObjects(objectProvider, providingFunction);
5260
}
@@ -68,8 +76,9 @@ public override bool Equals(object obj)
6876

6977
private bool Equals(Architecture other)
7078
{
71-
return Assemblies.Equals(other.Assemblies) && Namespaces.Equals(other.Namespaces) &&
72-
Types.Equals(other.Types);
79+
return Assemblies.Equals(other.Assemblies)
80+
&& Namespaces.Equals(other.Namespaces)
81+
&& Types.Equals(other.Types);
7382
}
7483

7584
public override int GetHashCode()
@@ -83,4 +92,4 @@ public override int GetHashCode()
8392
}
8493
}
8594
}
86-
}
95+
}

0 commit comments

Comments
 (0)