Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
petervhood committed Mar 14, 2024
2 parents bfe7149 + acc2444 commit 5afe8bb
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseOutputPath></BaseOutputPath>
<BaseIntermediateOutputPath />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseOutputPath></BaseOutputPath>
<BaseIntermediateOutputPath />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseOutputPath></BaseOutputPath>
<BaseIntermediateOutputPath />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseOutputPath></BaseOutputPath>
<BaseIntermediateOutputPath />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.App.Store/VpnHood.Client.App.Store.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.App/VpnHood.Client.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.Device/VpnHood.Client.Device.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client/VpnHood.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
28 changes: 19 additions & 9 deletions VpnHood.Common/Utils/VhTestUtil.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net;
using VpnHood.Common.Client;
using VpnHood.Common.Exceptions;

namespace VpnHood.Common.Utils;

[SuppressMessage("ReSharper", "UnusedMember.Global")]
public static class VhTestUtil
{
private class AssertException : Exception
public class AssertException : Exception
{
public AssertException(string? message = null)
: base(message)
Expand All @@ -35,12 +33,17 @@ public static async Task<bool> WaitForValue<TValue>(object? expectedValue, Func<
return false;
}

public static async Task<bool> WaitForValue<TValue>(object? expectedValue, Func<Task<TValue?>> valueFactory, int timeout = 5000)
public static Task<bool> WaitForValue<TValue>(object? expectedValue, Func<Task<TValue?>> valueFactory, int timeout = 5000)
{
return WaitForValue(expectedValue, valueFactory(), timeout);
}

public static async Task<bool> WaitForValue<TValue>(object? expectedValue, Task<TValue?> task, int timeout = 5000)
{
const int waitTime = 100;
for (var elapsed = 0; elapsed < timeout; elapsed += waitTime)
{
if (Equals(expectedValue, await valueFactory()))
if (Equals(expectedValue, await task))
return true;

await Task.Delay(waitTime);
Expand All @@ -63,13 +66,20 @@ public static async Task AssertEqualsWait<TValue>(object? expectedValue, Func<TV
AssertEquals(expectedValue, valueFactory(), message);
}

public static async Task AssertEqualsWait<TValue>(object? expectedValue, Func<Task<TValue?>> valueFactory,
public static Task AssertEqualsWait<TValue>(object? expectedValue, Func<Task<TValue?>> valueFactory,
string? message = null, int timeout = 5000)
{
await WaitForValue(expectedValue, valueFactory, timeout);
AssertEquals(expectedValue, await valueFactory(), message);
return AssertEqualsWait(expectedValue, valueFactory(), message, timeout);
}

public static async Task AssertEqualsWait<TValue>(object? expectedValue, Task<TValue?> task,
string? message = null, int timeout = 5000)
{
var result = await WaitForValue(expectedValue, task, timeout);
AssertEquals(expectedValue, result, message);
}


public static Task AssertApiException(HttpStatusCode expectedStatusCode, Task task, string? message = null)
{
return AssertApiException((int)expectedStatusCode, task, message);
Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Common/VpnHood.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Server.Access/VpnHood.Server.Access.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Server/VpnHood.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Tunneling/VpnHood.Tunneling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>3.3.476</Version>
<Version>3.3.477</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down

0 comments on commit 5afe8bb

Please sign in to comment.