mirror of https://github.com/Squidex/squidex.git
15 changed files with 174 additions and 68 deletions
@ -1,8 +1,8 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<configuration> |
<configuration> |
||||
<packageSources> |
<packageSources> |
||||
<add key="localfeed" value="libs" /> |
<add key="myget.org" value="https://dotnet.myget.org/F/orleans-ci/api/v3/index.json" protocolVersion="3" /> |
||||
<add key="myget.org" value="https://dotnet.myget.org/F/orleans-ci/api/v3/index.json" protocolVersion="3" /> |
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> |
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> |
||||
|
<add key="localfeed" value="libs" /> |
||||
</packageSources> |
</packageSources> |
||||
</configuration> |
</configuration> |
||||
Binary file not shown.
@ -0,0 +1 @@ |
|||||
|
44NJepeJdsgel9jiDTaWOXhCYM08/kGmW81dw8J31py1+4MJoOloWSUtk99fDbzM7X3/pdSNksJWb22liaDsVQ== |
||||
@ -0,0 +1,17 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> |
||||
|
<metadata> |
||||
|
<id>SharpPwned.NET</id> |
||||
|
<version>1.0.2-fix</version> |
||||
|
<authors>SharpPwned.NET</authors> |
||||
|
<owners>SharpPwned.NET</owners> |
||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
||||
|
<description>Package Description</description> |
||||
|
<dependencies> |
||||
|
<group targetFramework=".NETStandard1.4"> |
||||
|
<dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" /> |
||||
|
<dependency id="Newtonsoft.Json" version="10.0.3" exclude="Build,Analyzers" /> |
||||
|
</group> |
||||
|
</dependencies> |
||||
|
</metadata> |
||||
|
</package> |
||||
@ -0,0 +1,54 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Squidex.Infrastructure; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Squidex.Domain.Apps.Entities.TestHelpers |
||||
|
{ |
||||
|
public static class ValidationAssert |
||||
|
{ |
||||
|
public static void Throws(Action action, params ValidationError[] errors) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
action(); |
||||
|
|
||||
|
Assert.True(false, $"Expected {typeof(ValidationException)} but succeeded"); |
||||
|
} |
||||
|
catch (ValidationException ex) |
||||
|
{ |
||||
|
ex.Errors.ToArray().ShouldBeEquivalent(errors); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
Assert.True(false, $"Excepted {typeof(ValidationException)}, but got {ex.GetType()}"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static async Task ThrowsAsync(Func<Task> action, params ValidationError[] errors) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
await action(); |
||||
|
|
||||
|
Assert.True(false, $"Expected {typeof(ValidationException)} but succeeded"); |
||||
|
} |
||||
|
catch (ValidationException ex) |
||||
|
{ |
||||
|
ex.Errors.ToArray().ShouldBeEquivalent(errors); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
Assert.True(false, $"Excepted {typeof(ValidationException)}, but got {ex.GetType()}"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue