public void ControllerHasRouteAttributeWithRoute() { var mediator = new Mock<IMediator>(); var userManager = MockHelper.CreateUserManagerMock(); var signInManager = MockHelper.CreateSignInManagerMock(userManager); var sut = new MeApiController(userManager.Object, signInManager.Object, mediator.Object); var attribute = sut.GetAttributes().OfType<RouteAttribute>().SingleOrDefault(); Assert.NotNull(attribute); Assert.Equal(attribute.Template, "api/me"); }
public void ControllerHasRouteAtttributeWithTheCorrectRoute() { var sut = new MeApiController(); var attribute = sut.GetAttributes().OfType<AuthorizeAttribute>().SingleOrDefault(); Assert.NotNull(attribute); }