Skip to content

Commit d5b0d67

Browse files
Get the name of the InheritController dynamically in ControllerAttributesTestBuilderTests
1 parent ee87ea5 commit d5b0d67

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/MyTested.AspNetCore.Mvc.Controllers.Test/BuildersTests/AttributesTests/ControllerAttributesTestBuilderTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void PassingForShouldThrowExceptionWithIncorrectAttribute()
6666
},
6767
"When testing MvcController was expected to have ActionNameAttribute, but in fact such was not found.");
6868
}
69-
69+
7070
[Fact]
7171
public void PassingForShouldNotThrowExceptionWithCorrectPredicate()
7272
{
@@ -106,8 +106,6 @@ public void PassingForShouldThrowExceptionWithIncorrectAttributeWithPredicate()
106106
"When testing MvcController was expected to have ActionNameAttribute, but in fact such was not found.");
107107
}
108108

109-
110-
111109
[Fact]
112110
public void IncludingInheritedShouldIncludeAllCustomInheritedAttributesFromBaseClassesAndNotThrowException()
113111
{
@@ -133,7 +131,7 @@ public void TryingToAssertInheritedAttributesWithoutIncludingInheritedShouldThro
133131
.ContainingAttributeOfType<ValidateAntiForgeryTokenAttribute>()
134132
.ContainingAttributeOfType<AllowAnonymousAttribute>()
135133
.ContainingAttributeOfType<ResponseCacheAttribute>());
136-
}, "When testing InheritAttributesController was expected to have ValidateAntiForgeryTokenAttribute, but in fact such was not found.");
134+
}, $"When testing {nameof(InheritControllerAttributes)} was expected to have ValidateAntiForgeryTokenAttribute, but in fact such was not found.");
137135
}
138136
}
139137
}

0 commit comments

Comments
 (0)