|
1 | 1 | namespace Machine.Specifications.Runner.ReSharper.Adapters.Elements; |
2 | 2 |
|
3 | | -public class SpecificationElement : ISpecificationElement |
| 3 | +public class SpecificationElement( |
| 4 | + IContextElement context, |
| 5 | + string fieldName, |
| 6 | + string? ignoreReason = null, |
| 7 | + IBehaviorElement? behavior = null) |
| 8 | + : ISpecificationElement |
4 | 9 | { |
5 | | - public SpecificationElement(IContextElement context, string fieldName, string? ignoreReason = null, IBehaviorElement? behavior = null) |
6 | | - { |
7 | | - Id = behavior != null |
8 | | - ? $"{context.TypeName}.{behavior.FieldName}.{fieldName}" |
9 | | - : $"{context.TypeName}.{fieldName}"; |
10 | | - AggregateId = behavior != null |
11 | | - ? $"{context.TypeName}.{behavior.TypeName}.{fieldName}" |
12 | | - : $"{context.TypeName}.{fieldName}"; |
13 | | - IgnoreReason = ignoreReason; |
14 | | - Context = context; |
15 | | - FieldName = fieldName; |
16 | | - Behavior = behavior; |
17 | | - } |
| 10 | + public string Id { get; } = behavior != null |
| 11 | + ? $"{context.TypeName}.{behavior.FieldName}.{fieldName}" |
| 12 | + : $"{context.TypeName}.{fieldName}"; |
18 | 13 |
|
19 | | - public string Id { get; } |
| 14 | + public string AggregateId { get; } = behavior != null |
| 15 | + ? $"{context.TypeName}.{behavior.TypeName}.{fieldName}" |
| 16 | + : $"{context.TypeName}.{fieldName}"; |
20 | 17 |
|
21 | | - public string AggregateId { get; } |
| 18 | + public string? IgnoreReason { get; } = ignoreReason; |
22 | 19 |
|
23 | | - public string? IgnoreReason { get; } |
| 20 | + public IContextElement Context { get; } = context; |
24 | 21 |
|
25 | | - public IContextElement Context { get; } |
| 22 | + public string FieldName { get; } = fieldName; |
26 | 23 |
|
27 | | - public string FieldName { get; } |
28 | | - |
29 | | - public IBehaviorElement? Behavior { get; } |
| 24 | + public IBehaviorElement? Behavior { get; } = behavior; |
30 | 25 | } |
0 commit comments