public void GetApiControllers_WhereClassInheritsFromBaseController_ReturnsFirstControllerAndSecondControllerAndThirdController() { var result = _swaggerDocumentationAssemblyTools.GetApiControllerTypes(typeof(BaseController)); Assert.AreEqual(4, result.Count); Assert.IsTrue(result.Contains(typeof(FirstController))); Assert.IsTrue(result.Contains(typeof(SecondController))); Assert.IsTrue(result.Contains(typeof(ThirdController))); Assert.IsTrue(result.Contains(typeof(FourthController))); }
public string GetSwaggerApiList() { var allApiControllers = _swaggerDocumentationAssemblyTools.GetApiControllerTypes(typeof(TBaseApiControllerType)); var pertinentApiControllers = _swaggerDocumentationAssemblyTools.GetTypesThatAreDecoratedWithApiDocumentationAttribute(allApiControllers); var swaggerContents = _swaggerDocumentationCreator.GetSwaggerResourceList(pertinentApiControllers); return(_jsonSerializer.SerializeObject(swaggerContents)); }