Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first Unit and Integration Tests #2

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ Then, you can use the client like this:
```csharp

```

## Development

To run the integration test login to your docker to access the transformer.bee image.
```bash
docker login ghcr.io -u YOUR_GITHUB_USERNAME
```
then paste your PAT similarly to described in the [integration test CI pipeline](.github/workflows/integrationtests.yml)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace TransformerBeeClient.IntegrationTest;

/// <summary>
/// A fixture that sets up the http client factory and an injectable service collection
/// </summary>
public class ClientFixture : IClassFixture<ClientFixture>
{
public readonly IHttpClientFactory HttpClientFactory;

public readonly ServiceCollection ServiceCollection;

public ClientFixture()

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 15 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Non-nullable field 'HttpClientFactory' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
var services = new ServiceCollection();
services.AddHttpClient("TransformerBee", client =>
{
client.BaseAddress = new Uri("http://localhost:5021"); // Check docker-compose.yml
});
var serviceProvider = services.BuildServiceProvider();
ServiceCollection = services;
HttpClientFactory = serviceProvider.GetService<IHttpClientFactory>();

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference assignment.

Check warning on line 24 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ClientFixture.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference assignment.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace TransformerBeeClient.IntegrationTest;

/// <summary>
/// Tests that a connection to the API can be established
/// </summary>
public class ConnectionTests : IClassFixture<ClientFixture>
{

private readonly ClientFixture _client;

public ConnectionTests(ClientFixture clientFixture)
{
_client = clientFixture;
}

[Fact]
public async Task IsAvailable_Returns_True_If_Service_Is_Available()
{
var httpClientFactory = _client.HttpClientFactory;
var client = new TransformerBeeRestClient(httpClientFactory);
var result = await client.IsAvailable();
result.Should().BeTrue();
}

[Fact]
public async Task IsAvailable_Throws_Exception_If_Host_Is_Unavailable()
{
var services = new ServiceCollection();
services.AddHttpClient("TransformerBee", client =>
{
client.BaseAddress = new Uri("http://localhost:1234"); // <-- no service running under this address
});
var serviceProvider = services.BuildServiceProvider();
var client = new TransformerBeeRestClient(serviceProvider.GetService<IHttpClientFactory>());

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 38 in TransformerBeeClient/TransformerBeeClient.IntegrationTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.
var checkIfIsAvailable = async () => await client.IsAvailable();
await checkIfIsAvailable.Should().ThrowAsync<HttpRequestException>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace TransformerBeeClient.UnitTest;

public class ConnectionTests
{
[Fact]
public void IsAvailable_Throws_ArgumentNullException_If_BaseAddress_Is_Not_Configured()
{
var services = new ServiceCollection();
services.AddHttpClient("TransformerBee", client =>
{
client.BaseAddress = null;
});
var serviceProvider = services.BuildServiceProvider();
var instantiateClient = () => new TransformerBeeRestClient(serviceProvider.GetService<IHttpClientFactory>());

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.

Check warning on line 18 in TransformerBeeClient/TransformerBeeClient.UnitTest/ConnectionTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'httpClientFactory' in 'TransformerBeeRestClient.TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")'.
instantiateClient.Should().Throw<ArgumentNullException>();
}
}
13 changes: 0 additions & 13 deletions TransformerBeeClient/TransformerBeeClient.UnitTest/UnitTest1.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=de4efd69_002D9f4a_002D4e00_002D83fa_002Ddaa381865bd8/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="ConnectionTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;xUnit::80EF1570-CB4E-4E56-A8BC-56C787A48543::net8.0::TransformerBeeClient.UnitTest.ConnectionTests&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>
46 changes: 46 additions & 0 deletions TransformerBeeClient/TransformerBeeClient/RestClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace TransformerBeeClient;

/// <summary>
/// a client for the transformer.bee REST API
/// </summary>
public class TransformerBeeRestClient
{
private readonly HttpClient _httpClient;

/// <summary>
/// Provide the constructor with a http client factory.
/// It will create a client from said factory and use the <paramref name="clientName"/> for that.
/// </summary>
/// <param name="httpClientFactory">factory to create the http client from</param>
/// <param name="clientName">name used to create the client</param>
public TransformerBeeRestClient(IHttpClientFactory httpClientFactory, string clientName = "TransformerBee")
{
_httpClient = httpClientFactory.CreateClient(clientName);
if (_httpClient.BaseAddress == null)
{
throw new ArgumentNullException(nameof(httpClientFactory), $"The http client factory must provide a base address for the client with name '{clientName}'");
}
}

/// <summary>
/// tests if transformer bee is available
/// </summary>
/// <remarks>
/// Note that this does _not_ check if you're authenticated.
/// The method will probably throw an <see cref="HttpRequestException"/> if the host cannot be found.
/// </remarks>
/// <returns>
/// Returns true iff the transformer bee is available under the configured base address.
/// </returns>
public async Task<bool> IsAvailable()
{
var uriBuilder = new UriBuilder(_httpClient!.BaseAddress)

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 6.0.201)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 7.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.

Check warning on line 37 in TransformerBeeClient/TransformerBeeClient/RestClient.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 8.0.100)

Possible null reference argument for parameter 'uri' in 'UriBuilder.UriBuilder(Uri uri)'.
{
Path = "/version"
};

var versionUrl = uriBuilder.Uri.AbsoluteUri;
var response = await _httpClient.GetAsync(versionUrl);
return response.IsSuccessStatusCode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@
<TargetFrameworks>net8.0;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>

</Project>