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