Ejemplo n.º 1
0
        public void ControllerHasProducesAtttributeWithTheCorrectContentType()
        {
            var sut       = new ResourceApiController(null);
            var attribute = sut.GetAttributes().OfType <ProducesAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("application/json", attribute.ContentTypes.Select(x => x).First());
        }
Ejemplo n.º 2
0
        public void ControllerHasRouteAtttributeWithTheCorrectTemplate()
        {
            var sut       = new ResourceApiController(null);
            var attribute = sut.GetAttributes().OfType <RouteAttribute>().SingleOrDefault();

            Assert.NotNull(attribute);
            Assert.Equal("api/resource", attribute.Template);
        }