Created
June 11, 2014 06:07
-
-
Save cottsak/6b21b2e91efb01755dc5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class controllers_should | |
{ | |
[Fact] | |
public void derive_from_from_our_base() | |
{ | |
foreach (var controller in GetControllersThatDontNeedAuth()) | |
{ | |
var authenticatedControllerType = typeof(AuthenticatedController); | |
Assert.True(controller.IsSubclassOf(authenticatedControllerType),string.Format("{0} should derive from {1}", controller.Name, authenticatedControllerType.Name)); | |
//controller.IsSubclassOf(authenticatedControllerType).ShouldBe(true); // the message from this line isn't very helpful | |
} | |
} | |
} | |
Error message is:
controller.IsSubclassOf(authenticatedControllerType)
should be
True
but was
False
Not as helpful as: TestController should derive from AuthenticatedController
Inline authenticatedControllerType
?
The message then becomes this Rob:
controller.IsSubclassOf(typeof(AuthenticatedController))
should be
True
but was
False
not the greatest
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The error message for the commented out line should be:
controller.IsSubclassOf(authenticatedControllerType) Should Be true
, which should be ok?Or use
controller.ShouldBeAssignableTo(authenticatedControllerType)
instead