コード例 #1
0
 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");
 }
コード例 #2
0
 public void ControllerHasRouteAtttributeWithTheCorrectRoute()
 {
     var sut = new CampaignApiController(null);
     var attribute = sut.GetAttributes().OfType<RouteAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "api/campaign");
 }