public void ControllerHasProducesAtttributeWithTheCorrectContentType() { var sut = new ActivityApiController(null); var attribute = sut.GetAttributes().OfType<ProducesAttribute>().SingleOrDefault(); Assert.NotNull(attribute); Assert.Equal(attribute.ContentTypes.Select(x => x.MediaType).First(), "application/json"); }
public void ControllerHasRouteAtttributeWithTheCorrectRoute() { var sut = new ActivityApiController(null); var attribute = sut.GetAttributes().OfType<RouteAttribute>().SingleOrDefault(); Assert.NotNull(attribute); Assert.Equal(attribute.Template, "api/activity"); }