public void NoControllers_Returns_EmptyMetadata() { var apis = new List<ApiDescription>(); var factory = new MetadataFactory(apis); var meta = factory.CreateMetadata(); Assert.AreEqual(0, meta.Count(), "metadata items"); }
public void OneControllers_Returns_OneControllerMetadata() { var mockControllerDesc = repo.Stub<HttpControllerDescriptor>(); mockControllerDesc.ControllerName = "Test"; var mockAction = repo.Stub<HttpActionDescriptor>(); mockAction.ControllerDescriptor = mockControllerDesc; mockAction.ReturnType.Stub(type => typeof (TestReturnType)); var mockApi = repo.Stub<ApiDescription>(); mockApi.ActionDescriptor = mockAction; var apis = new List<ApiDescription>() { mockApi }; var factory = new MetadataFactory(apis); var meta = factory.CreateMetadata(); Assert.AreEqual(1, meta.Count(), "metadata items"); }