public Bind() { Routes.MapHttpRoute("create_binding", "v2/service_instances/{instanceId}/service_bindings/{bindingId}"); var catalog = new Catalog(Substitute.For<IDatabaseBuilder>()); service = Substitute.For<ICloudFoundryService>(); serviceId = Guid.NewGuid(); catalog.Services.Add(serviceId.ToString(), service); controller = new CatalogController(catalog); }
public void ReturnsCatalogOfServices() { var catalog = new Catalog(Substitute.For<IDatabaseBuilder>()); var service = Substitute.For<ICloudFoundryService>(); var serviceId = Guid.NewGuid(); catalog.Services.Add(serviceId.ToString(), service); var controller = new CatalogController(catalog); IHttpActionResult result = controller.Get(); var response = result as OkNegotiatedContentResult<CatalogResponse>; Assert.NotNull(response); Assert.Equal(2, response.Content.Services.Count); }