public void GetAllProjects_Success() { SetupResponse("api/components/search", RestResponseFactory.CreateGetProjects_ValidResponse()); var service = new ComponentsClient(MockClient.Object); var expected = new List <SonarQubeProject>() { new SonarQubeProject { Key = "ETAS:INCA:HWA:A1b:LIN", Name = "ETAS-INCA-HWA-A1b-LIN" }, new SonarQubeProject { Key = "ETAS:INCA:HWA:A1b:UDS", Name = "ETAS-INCA-HWA-A1b-UDS" }, new SonarQubeProject { Key = "ETAS:INCA:HWA:A1b:MT1To2", Name = "ETAS-INCA-HWA-A1b-MT1To2" } }; var actual = service.GetAllProjects().Result; Assert.That(actual.Count, Is.EqualTo(expected.Count)); for (var i = 0; i < actual.Count; ++i) { Assert.That(actual[i].Key, Is.EqualTo(expected[i].Key)); Assert.That(actual[i].Name, Is.EqualTo(expected[i].Name)); } }
public SearchBilling() { customersClient = new CustomersClient(serviceAddress); ordersClient = new OrdersClient(serviceAddress); goodsClient = new GoodsClient(serviceAddress); componentsClient = new ComponentsClient(serviceAddress); }
public void GetAllProjects_NoProjects() { SetupResponse("api/components/search", RestResponseFactory.CreateComponentsResponse_NoProjects()); var service = new ComponentsClient(MockClient.Object); var projects = service.GetAllProjects().Result; Assert.That(projects.Count, Is.EqualTo(0)); }
public async Task GetComponentAsync(string realm) { var components = await ComponentsClient.GetComponentsAsync(realm); string componentId = components.FirstOrDefault()?.Id; if (componentId != null) { var result = await ComponentsClient.GetComponentAsync(realm, componentId); Assert.NotNull(result); } }
public async Task GetComponentsAsync(string realm) { var result = await ComponentsClient.GetComponentsAsync(realm); Assert.NotNull(result); }