-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathFailedArchRuleException.cs
More file actions
27 lines (25 loc) · 1.1 KB
/
FailedArchRuleException.cs
File metadata and controls
27 lines (25 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections.Generic;
using ArchUnitNET.Domain;
using ArchUnitNET.Fluent;
using ArchUnitNET.Fluent.Extensions;
using TUnit.Assertions.Exceptions;
// ReSharper disable once CheckNamespace
namespace ArchUnitNET.TUnit
{
public class FailedArchRuleException : BaseAssertionException
{
/// <summary>
/// Creates a new instance of the <see href="FailedArchRuleException" /> class.
/// </summary>
/// <param name="architecture">The architecture which was tested</param>
/// <param name="archRule">The archrule that failed</param>
public FailedArchRuleException(Architecture architecture, IArchRule archRule)
: this(archRule.Evaluate(architecture)) { }
/// <summary>
/// Creates a new instance of the <see href="FailedArchRuleException" /> class.
/// </summary>
/// <param name="evaluationResults">The results of the evaluation of the archrule</param>
public FailedArchRuleException(IEnumerable<EvaluationResult> evaluationResults)
: base(evaluationResults.ToErrorMessage()) { }
}
}