Skip to content

Commit

Permalink
Update changelog, fix project url
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Mar 3, 2022
1 parent 7661784 commit e2f7daf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### 6.4.2
- Fix README links in NuGet package.
### 6.4.3
- Fix README links displayed on the NuGet package page.

### 6.4.0
- **Introduced a new configuration API replacing the builder pattern**:
Expand Down
20 changes: 17 additions & 3 deletions src/ConfigCat.Client.Tests/ConfigCacheTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading;
using System.Net.Http;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

Expand All @@ -10,6 +11,7 @@ namespace ConfigCat.Client.Tests
public class ConfigCacheTests
{
private const string SDKKEY = "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A";
private static readonly HttpClientHandler sharedHandler = new HttpClientHandler();

[DataRow(true)]
[DataRow(false)]
Expand All @@ -33,12 +35,14 @@ public void ConfigCache_Override_AutoPoll_Works(bool useNewCreateApi)
options.Logger = new ConsoleLogger(LogLevel.Debug);
options.PollingMode = PollingModes.AutoPoll();
options.ConfigCache = configCacheMock.Object;
options.HttpClientHandler = sharedHandler;
})
: ConfigCatClientBuilder
.Initialize(SDKKEY)
.WithLogger(new ConsoleLogger(LogLevel.Debug))
.WithAutoPoll()
.WithConfigCache(configCacheMock.Object)
.WithHttpClientHandler(sharedHandler)
.Create();

var actual = client.GetValue("stringDefaultCat", "N/A");
Expand Down Expand Up @@ -70,8 +74,13 @@ public void ConfigCache_Override_ManualPoll_Works(bool useNewCreateApi)
options.Logger = new ConsoleLogger(LogLevel.Debug);
options.PollingMode = PollingModes.ManualPoll;
options.ConfigCache = configCacheMock.Object;
options.HttpClientHandler = sharedHandler;
})
: ConfigCatClientBuilder.Initialize(SDKKEY).WithManualPoll().WithConfigCache(configCacheMock.Object).Create();
: ConfigCatClientBuilder.Initialize(SDKKEY)
.WithManualPoll()
.WithConfigCache(configCacheMock.Object)
.WithHttpClientHandler(sharedHandler)
.Create();

configCacheMock.Verify(c => c.SetAsync(It.IsAny<string>(), It.IsAny<ProjectConfig>()), Times.Never);
configCacheMock.Verify(c => c.GetAsync(It.IsAny<string>(), CancellationToken.None), Times.Never);
Expand Down Expand Up @@ -111,8 +120,13 @@ public void ConfigCache_Override_LazyLoad_Works(bool useNewCreateApi)
options.Logger = new ConsoleLogger(LogLevel.Debug);
options.PollingMode = PollingModes.LazyLoad();
options.ConfigCache = configCacheMock.Object;
options.HttpClientHandler = sharedHandler;
})
: ConfigCatClientBuilder.Initialize(SDKKEY).WithLazyLoad().WithConfigCache(configCacheMock.Object).Create();
: ConfigCatClientBuilder.Initialize(SDKKEY)
.WithLazyLoad()
.WithConfigCache(configCacheMock.Object)
.WithHttpClientHandler(sharedHandler)
.Create();

var actual = client.GetValue("stringDefaultCat", "N/A");
Assert.AreEqual("Cat", actual);
Expand Down
14 changes: 11 additions & 3 deletions src/ConfigCat.Client.Tests/SynchronizationContextDeadlockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Net.Http;

#pragma warning disable CS0618 // Type or member is obsolete
namespace ConfigCat.Client.Tests
Expand All @@ -13,6 +14,7 @@ namespace ConfigCat.Client.Tests
public class SynchronizationContextDeadlockTests
{
private const string SDKKEY = "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A";
private static readonly HttpClientHandler sharedHandler = new HttpClientHandler();

private readonly Mock<SynchronizationContext> syncContextMock;

Expand Down Expand Up @@ -52,11 +54,13 @@ public void AutoPollDeadLockCheck(bool useNewCreateApi)
{
options.SdkKey = SDKKEY;
options.Logger = new ConsoleLogger(LogLevel.Off);
options.HttpClientHandler = sharedHandler;
})
: new ConfigCatClient(new AutoPollConfiguration
{
SdkKey = SDKKEY,
Logger = new ConsoleLogger(LogLevel.Off)
Logger = new ConsoleLogger(LogLevel.Off),
HttpClientHandler = sharedHandler,
});

ClientDeadlockCheck(client);
Expand All @@ -72,11 +76,13 @@ public void ManualPollDeadLockCheck(bool useNewCreateApi)
{
options.SdkKey = SDKKEY;
options.Logger = new ConsoleLogger(LogLevel.Off);
options.HttpClientHandler = sharedHandler;
})
: new ConfigCatClient(new ManualPollConfiguration
{
SdkKey = SDKKEY,
Logger = new ConsoleLogger(LogLevel.Off)
Logger = new ConsoleLogger(LogLevel.Off),
HttpClientHandler = sharedHandler,
});

ClientDeadlockCheck(client);
Expand All @@ -92,11 +98,13 @@ public void LazyLoadDeadLockCheck(bool useNewCreateApi)
{
options.SdkKey = SDKKEY;
options.Logger = new ConsoleLogger(LogLevel.Off);
options.HttpClientHandler = sharedHandler;
})
: new ConfigCatClient(new LazyLoadConfiguration
{
SdkKey = SDKKEY,
Logger = new ConsoleLogger(LogLevel.Off)
Logger = new ConsoleLogger(LogLevel.Off),
HttpClientHandler = sharedHandler,
});

ClientDeadlockCheck(client);
Expand Down
2 changes: 1 addition & 1 deletion src/ConfigCatClient/ConfigCatClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Company>ConfigCat</Company>
<Authors>ConfigCat</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ConfigCat/.net-sdk</PackageProjectUrl>
<PackageProjectUrl>https://configcat.com/docs/sdk-reference/csharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/ConfigCat/.net-sdk</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit e2f7daf

Please sign in to comment.