chore(dev) Update to csharpier 1.0 (#284)
* Update to csharpier 1.0 * Fix check and nowarn * format
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"csharpier": {
|
||||
"version": "0.30.6",
|
||||
"version": "1.0.0",
|
||||
"commands": [
|
||||
"dotnet-csharpier"
|
||||
"csharpier"
|
||||
],
|
||||
"rollForward": false
|
||||
},
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Directory.Build.targets
|
||||
Directory.Build.props
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
printWidth: 120
|
||||
useTabs: false
|
||||
tabWidth: 2
|
||||
indentSize: 2
|
||||
preprocessorSymbolSets:
|
||||
- ""
|
||||
- "DEBUG"
|
||||
|
||||
+8
-21
@@ -1,5 +1,4 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup Label="Compiler Properties">
|
||||
<LangVersion>12</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -7,7 +6,6 @@
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nugetspec Package Properties">
|
||||
<!-- Defines common Nugetspec properties -->
|
||||
<!-- Inheriting packable projects should define the rest of the nugetspec properties (PackageId, Description) -->
|
||||
@@ -22,18 +20,16 @@
|
||||
<PackageTags>speckle</PackageTags>
|
||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nuget Package Properties">
|
||||
<IsPackable>false</IsPackable> <!--Can be set to true in inheriting .props/.csproj files for projects that should be packed-->
|
||||
<IsPackable>false</IsPackable>
|
||||
<!--Can be set to true in inheriting .props/.csproj files for projects that should be packed-->
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Analyers">
|
||||
<EnableNetAnalyzers>true</EnableNetAnalyzers>
|
||||
<AnalysisLevel>latest-AllEnabledByDefault</AnalysisLevel>
|
||||
@@ -41,7 +37,6 @@
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
|
||||
<!-- Ingored warnings, some aspirational but too noisy for now, some by design. -->
|
||||
<NoWarn>
|
||||
<!--Disabled by design-->
|
||||
@@ -59,28 +54,20 @@
|
||||
<!-- Aspirational -->
|
||||
CA1502;CA1716;NETSDK1206;
|
||||
$(NoWarn)
|
||||
</NoWarn>
|
||||
</NoWarn
|
||||
>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Expose the repository root to all projects -->
|
||||
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
|
||||
<None
|
||||
Condition="'$(IsPackable)' == 'true'"
|
||||
Include="..\..\logo.png"
|
||||
Pack="true"
|
||||
PackagePath="\"
|
||||
Visible="false"/>
|
||||
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
|
||||
<None Condition="'$(IsPackable)' == 'true'" Include="..\..\logo.png" Pack="true" PackagePath="\" Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- This file contains the configuration for some analyzer warnings, such as cyclomatic
|
||||
complexity threshold -->
|
||||
<AdditionalFiles Include="$(RepositoryRoot)CodeMetricsConfig.txt"/>
|
||||
<AdditionalFiles Include="$(RepositoryRoot)CodeMetricsConfig.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
+13
-14
@@ -1,18 +1,17 @@
|
||||
<Project>
|
||||
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
|
||||
<NoWarn>
|
||||
$(NoWarn);
|
||||
<!-- Things we need to test -->
|
||||
CS0618;CA1034;CA2201;CA1051;CA1040;CA1724;
|
||||
IDE0044;IDE0130;CA1508;
|
||||
<!-- Analysers that provide no tangeable value to a test project -->
|
||||
CA5394;CA2007;CA1852;CA1819;CA1711;CA1063;CA1816;CA2234;CS8618;CA1054;CA1810;CA2208;CA1019;CA1831;
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
|
||||
<NoWarn>
|
||||
<!-- Things we need to test -->
|
||||
CS0618;CA1034;CA2201;CA1051;CA1040;CA1724;
|
||||
IDE0044;IDE0130;CA1508;
|
||||
<!-- Analysers that provide no tangeable value to a test project -->
|
||||
CA5394;CA2007;CA1852;CA1819;CA1711;CA1063;CA1816;CA2234;CS8618;CA1054;CA1810;CA2208;CA1019;CA1831;
|
||||
$(NoWarn);
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<Target Name="DeepClean">
|
||||
<Message Text="Deep clean of $(MSBuildProjectName).csproj" Importance="high"/>
|
||||
<RemoveDir Directories="$(BaseIntermediateOutputPath)"/>
|
||||
<RemoveDir Directories="$(BaseOutputPath)"/>
|
||||
<Message Text="Deep clean of $(MSBuildProjectName).csproj" Importance="high" />
|
||||
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
|
||||
<RemoveDir Directories="$(BaseOutputPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ Target(
|
||||
|
||||
Target(RESTORE_TOOLS, () => RunAsync("dotnet", "tool restore"));
|
||||
|
||||
Target(FORMAT, dependsOn: [RESTORE_TOOLS], () => RunAsync("dotnet", "csharpier --check ."));
|
||||
Target(FORMAT, dependsOn: [RESTORE_TOOLS], () => RunAsync("dotnet", "csharpier check ."));
|
||||
|
||||
Target(RESTORE, dependsOn: [FORMAT], () => RunAsync("dotnet", "restore Speckle.Sdk.sln --locked-mode"));
|
||||
|
||||
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bullseye" />
|
||||
<PackageReference Include="Glob" />
|
||||
<PackageReference Include="SimpleExec" />
|
||||
|
||||
@@ -68,7 +68,6 @@ public class Plane : Base, ITransformable<Plane>
|
||||
/// Returns the values of this <see cref="Plane"/> as a list of numbers
|
||||
/// </summary>
|
||||
/// <returns>A list of values representing the Plane.</returns>
|
||||
|
||||
public List<double> ToList()
|
||||
{
|
||||
var list = new List<double>();
|
||||
|
||||
@@ -147,7 +147,6 @@ public class Surface : Base, IHasBoundingBox, IHasArea, ITransformable<Surface>
|
||||
/// </summary>
|
||||
/// <returns>A 2-dimensional array representing this <see cref="Surface"/>s control points.</returns>
|
||||
/// <remarks>The ControlPoints will be ordered following directions "[u][v]"</remarks>
|
||||
|
||||
public List<List<ControlPoint>> GetControlPoints()
|
||||
{
|
||||
var matrix = new List<List<ControlPoint>>();
|
||||
|
||||
@@ -1,37 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup Label="Compiler Properties">
|
||||
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
|
||||
<PolySharpExcludeGeneratedTypes>System.Runtime.CompilerServices.RequiresLocationAttribute</PolySharpExcludeGeneratedTypes>
|
||||
<Configurations>Debug;Release;Local</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nugetspec Package Properties">
|
||||
<PackageId>Speckle.Objects</PackageId>
|
||||
<Description>Objects is the default object model for Speckle</Description>
|
||||
<PackageTags>$(PackageTags) objects</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nuget Package Properties">
|
||||
<IsPackable>true</IsPackable>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Analyers">
|
||||
<NoWarn>
|
||||
$(NoWarn);
|
||||
CA1819;CA1008;CA2225;
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Expose internals to test projects">
|
||||
<InternalsVisibleTo Include="Speckle.Objects.Tests.Unit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup Label="Compiler Properties">
|
||||
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
|
||||
<Configurations>Debug;Release;Local</Configurations>
|
||||
@@ -7,30 +6,26 @@
|
||||
<ILRepackRenameInternalized>true</ILRepackRenameInternalized>
|
||||
<ILRepackMergeDebugSymbols>true</ILRepackMergeDebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nugetspec Package Properties">
|
||||
<PackageId>Speckle.Sdk.Dependencies</PackageId>
|
||||
<Description>The .NET SDK for Speckle</Description>
|
||||
<PackageTags>$(PackageTags) core sdk</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nuget Package Properties">
|
||||
<IsPackable>true</IsPackable>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ILRepack.FullAuto">
|
||||
<PackageReference Include="ILRepack.FullAuto">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" PrivateAssets="all" />
|
||||
<PackageReference Include="Polly" PrivateAssets="all" />
|
||||
<PackageReference Include="Polly.Contrib.WaitAndRetry" PrivateAssets="all" />
|
||||
<PackageReference Include="Polly.Extensions.Http" PrivateAssets="all" />
|
||||
<PackageReference Include="Open.ChannelExtensions" PrivateAssets="all" />
|
||||
<PackageReference Include="System.Threading.Channels" PrivateAssets="all" />
|
||||
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,50 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup Label="Compiler Properties">
|
||||
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
|
||||
<Configurations>Debug;Release;Local</Configurations>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nugetspec Package Properties">
|
||||
<PackageId>Speckle.Sdk</PackageId>
|
||||
<Description>The .NET SDK for Speckle</Description>
|
||||
<PackageTags>$(PackageTags) core sdk</PackageTags>
|
||||
<NoWarn>$(NoWarn);CS8618</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nuget Package Properties">
|
||||
<IsPackable>true</IsPackable>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Expose internals to test projects">
|
||||
<InternalsVisibleTo Include="Speckle.Sdk.Tests.Unit" />
|
||||
<InternalsVisibleTo Include="Speckle.Sdk.Tests.Integration" />
|
||||
<InternalsVisibleTo Include="Speckle.Sdk.Serialization.Tests" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="GraphQL.Client"/>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="GraphQL.Client" />
|
||||
<PackageReference Include="Microsoft.CSharp" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite"/>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" />
|
||||
<PackageReference Include="Speckle.DoubleNumerics" />
|
||||
<PackageReference Include="Speckle.Newtonsoft.Json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" OverrideVersion="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" OverrideVersion="8.0.0"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" OverrideVersion="8.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Speckle.Sdk.Dependencies\Speckle.Sdk.Dependencies.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<PolySharpExcludeGeneratedTypes>System.Runtime.CompilerServices.IsExternalInit</PolySharpExcludeGeneratedTypes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="altcover" />
|
||||
<PackageReference Include="AwesomeAssertions" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit.assert" />
|
||||
<PackageReference Include="xunit.runner.visualstudio"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Objects\Speckle.Objects.csproj" />
|
||||
<ProjectReference Include="..\Speckle.Sdk.Testing\Speckle.Sdk.Testing.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
<ProjectReference Include="..\Speckle.Sdk.Tests.Performance\Speckle.Sdk.Tests.Performance.csproj" />
|
||||
@@ -13,5 +12,4 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -41,8 +41,8 @@ public class CancellationTests
|
||||
new SerializeProcessOptions(true, true, false, true)
|
||||
);
|
||||
await cancellationSource.CancelAsync();
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(
|
||||
async () => await serializeProcess.Serialize(testClass)
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(async () =>
|
||||
await serializeProcess.Serialize(testClass)
|
||||
);
|
||||
await Verify(ex);
|
||||
cancellationSource.IsCancellationRequested.Should().BeTrue();
|
||||
@@ -62,8 +62,8 @@ public class CancellationTests
|
||||
cancellationSource.Token,
|
||||
new SerializeProcessOptions(true, true, false, true)
|
||||
);
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(
|
||||
async () => await serializeProcess.Serialize(testClass)
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(async () =>
|
||||
await serializeProcess.Serialize(testClass)
|
||||
);
|
||||
await Verify(ex);
|
||||
cancellationSource.IsCancellationRequested.Should().BeTrue();
|
||||
@@ -83,8 +83,8 @@ public class CancellationTests
|
||||
new SerializeProcessOptions(true, true, false, true)
|
||||
);
|
||||
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(
|
||||
async () => await serializeProcess.Serialize(testClass)
|
||||
var ex = await Assert.ThrowsAsync<OperationCanceledException>(async () =>
|
||||
await serializeProcess.Serialize(testClass)
|
||||
);
|
||||
await Verify(ex);
|
||||
cancellationSource.IsCancellationRequested.Should().BeTrue();
|
||||
|
||||
@@ -1,30 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<PolySharpExcludeGeneratedTypes>System.Runtime.CompilerServices.IsExternalInit;System.Runtime.CompilerServices.RequiresLocationAttribute</PolySharpExcludeGeneratedTypes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="altcover" />
|
||||
<PackageReference Include="AwesomeAssertions" />
|
||||
<PackageReference Include="HttpMultipartParser" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="RichardSzalay.MockHttp" />
|
||||
<PackageReference Include="xunit.assert" />
|
||||
<PackageReference Include="xunit.runner.visualstudio"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Speckle.Sdk.Testing\Speckle.Sdk.Testing.csproj" />
|
||||
<ProjectReference Include="..\..\src\Speckle.Objects\Speckle.Objects.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="RevitObject.json.gz" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="Verify.Quibble" />
|
||||
<PackageReference Include="Verify.Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="Verify.Quibble" />
|
||||
<PackageReference Include="Verify.Xunit" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -48,8 +48,8 @@ public class GraphQLClientExceptionHandling : IAsyncLifetime
|
||||
|
||||
""";
|
||||
GraphQLRequest request = new(query: QUERY);
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => await _sut.ExecuteGraphQLRequest<dynamic>(request).ConfigureAwait(false)
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
await _sut.ExecuteGraphQLRequest<dynamic>(request).ConfigureAwait(false)
|
||||
);
|
||||
ex.InnerExceptions.OfType<SpeckleGraphQLForbiddenException>().Count().Should().Be(1);
|
||||
}
|
||||
@@ -66,8 +66,8 @@ public class GraphQLClientExceptionHandling : IAsyncLifetime
|
||||
}
|
||||
""";
|
||||
GraphQLRequest request = new(query: QUERY);
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => await _sut.ExecuteGraphQLRequest<dynamic>(request).ConfigureAwait(false)
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
await _sut.ExecuteGraphQLRequest<dynamic>(request).ConfigureAwait(false)
|
||||
);
|
||||
ex.InnerExceptions.OfType<SpeckleGraphQLInvalidQueryException>().Count().Should().Be(1);
|
||||
}
|
||||
@@ -79,8 +79,8 @@ public class GraphQLClientExceptionHandling : IAsyncLifetime
|
||||
public async Task TestGraphQLLayer_BadInput()
|
||||
{
|
||||
ProjectUpdateRoleInput input = new(null!, null!, null);
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => await _sut.Project.UpdateRole(input).ConfigureAwait(false)
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
await _sut.Project.UpdateRole(input).ConfigureAwait(false)
|
||||
);
|
||||
ex.InnerExceptions.OfType<SpeckleGraphQLBadInputException>().Count().Should().Be(2);
|
||||
}
|
||||
@@ -91,8 +91,8 @@ public class GraphQLClientExceptionHandling : IAsyncLifetime
|
||||
using CancellationTokenSource cts = new();
|
||||
await cts.CancelAsync();
|
||||
|
||||
var ex = await Assert.ThrowsAsync<TaskCanceledException>(
|
||||
async () => await _sut.ActiveUser.Get(cts.Token).ConfigureAwait(false)
|
||||
var ex = await Assert.ThrowsAsync<TaskCanceledException>(async () =>
|
||||
await _sut.ActiveUser.Get(cts.Token).ConfigureAwait(false)
|
||||
);
|
||||
|
||||
ex.CancellationToken.Should().BeEquivalentTo(cts.Token);
|
||||
@@ -121,8 +121,8 @@ public class GraphQLClientExceptionHandling : IAsyncLifetime
|
||||
}
|
||||
""";
|
||||
GraphQLRequest request = new(query: QUERY);
|
||||
await Assert.ThrowsAsync<JsonReaderException>(
|
||||
async () => await _sut.ExecuteGraphQLRequest<int>(request).ConfigureAwait(false)
|
||||
await Assert.ThrowsAsync<JsonReaderException>(async () =>
|
||||
await _sut.ExecuteGraphQLRequest<int>(request).ConfigureAwait(false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-8
@@ -54,8 +54,8 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime
|
||||
|
||||
Project privateStream = await Sut.Create(input);
|
||||
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => _ = await _unauthedUser.Project.Get(privateStream.id)
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
_ = await _unauthedUser.Project.Get(privateStream.id)
|
||||
);
|
||||
ex.InnerExceptions.Single().Should().BeOfType<SpeckleGraphQLForbiddenException>();
|
||||
}
|
||||
@@ -70,8 +70,8 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime
|
||||
[Fact]
|
||||
public async Task ProjectUpdate_NonExistentProject()
|
||||
{
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => _ = await Sut.Update(new("NonExistentProject", "My new name"))
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
_ = await Sut.Update(new("NonExistentProject", "My new name"))
|
||||
);
|
||||
ex.InnerExceptions.Single().Should().BeOfType<SpeckleGraphQLStreamNotFoundException>();
|
||||
}
|
||||
@@ -79,8 +79,8 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime
|
||||
[Fact]
|
||||
public async Task ProjectUpdate_NoAuth()
|
||||
{
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => _ = await _unauthedUser.Project.Update(new(_testProject.id, "My new name"))
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
|
||||
_ = await _unauthedUser.Project.Update(new(_testProject.id, "My new name"))
|
||||
);
|
||||
ex.InnerExceptions.Single().Should().BeOfType<SpeckleGraphQLForbiddenException>();
|
||||
}
|
||||
@@ -107,8 +107,7 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime
|
||||
{
|
||||
ProjectUpdateRoleInput input = new(_secondUser.Account.id.NotNull(), "NonExistentProject", newRole);
|
||||
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(
|
||||
async () => _ = await _unauthedUser.Project.UpdateRole(input)
|
||||
var ex = await Assert.ThrowsAsync<AggregateException>(async () => _ = await _unauthedUser.Project.UpdateRole(input)
|
||||
);
|
||||
ex.InnerExceptions.Single().Should().BeOfType<SpeckleGraphQLForbiddenException>();
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ public class UserServerInfoTests : IAsyncLifetime
|
||||
Uri serverUrl = new(_acc.serverInfo.url);
|
||||
|
||||
await FluentActions
|
||||
.Invoking(
|
||||
async () => await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetServerInfo(serverUrl)
|
||||
.Invoking(async () =>
|
||||
await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetServerInfo(serverUrl)
|
||||
)
|
||||
.Should()
|
||||
.ThrowAsync<HttpRequestException>();
|
||||
@@ -53,8 +53,8 @@ public class UserServerInfoTests : IAsyncLifetime
|
||||
Uri serverUrl = new("http://invalidserver.local");
|
||||
|
||||
await FluentActions
|
||||
.Invoking(
|
||||
async () => await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetServerInfo(serverUrl)
|
||||
.Invoking(async () =>
|
||||
await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetServerInfo(serverUrl)
|
||||
)
|
||||
.Should()
|
||||
.ThrowAsync<HttpRequestException>();
|
||||
@@ -81,8 +81,8 @@ public class UserServerInfoTests : IAsyncLifetime
|
||||
Uri serverUrl = new("http://invalidserver.local");
|
||||
|
||||
await FluentActions
|
||||
.Invoking(
|
||||
async () => await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetUserInfo("", serverUrl)
|
||||
.Invoking(async () =>
|
||||
await Fixtures.ServiceProvider.GetRequiredService<IAccountManager>().GetUserInfo("", serverUrl)
|
||||
)
|
||||
.Should()
|
||||
.ThrowAsync<HttpRequestException>();
|
||||
@@ -93,11 +93,10 @@ public class UserServerInfoTests : IAsyncLifetime
|
||||
{
|
||||
Uri serverUrl = new(_acc.serverInfo.url);
|
||||
await FluentActions
|
||||
.Invoking(
|
||||
async () =>
|
||||
await Fixtures
|
||||
.ServiceProvider.GetRequiredService<IAccountManager>()
|
||||
.GetUserInfo("Bearer 08913c3c1e7ac65d779d1e1f11b942a44ad9672ca9", serverUrl)
|
||||
.Invoking(async () =>
|
||||
await Fixtures
|
||||
.ServiceProvider.GetRequiredService<IAccountManager>()
|
||||
.GetUserInfo("Bearer 08913c3c1e7ac65d779d1e1f11b942a44ad9672ca9", serverUrl)
|
||||
)
|
||||
.Should()
|
||||
.ThrowAsync<GraphQLHttpRequestException>();
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<PolySharpExcludeGeneratedTypes>System.Runtime.CompilerServices.IsExternalInit</PolySharpExcludeGeneratedTypes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="altcover" />
|
||||
<PackageReference Include="AwesomeAssertions" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit" />
|
||||
<PackageReference Include="xunit.runner.visualstudio"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
<ProjectReference Include="..\Speckle.Sdk.Testing\Speckle.Sdk.Testing.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -27,7 +27,6 @@ public class GeneralDeserializer : IDisposable
|
||||
private const string streamId = "a3ac1b2706";
|
||||
private const string rootId = "7d53bcf28c6696ecac8781684a0aa006";*/
|
||||
|
||||
|
||||
private const string url = "https://latest.speckle.systems/projects/2099ac4b5f/models/da511c4d1e"; //perf?
|
||||
private const string streamId = "2099ac4b5f";
|
||||
private const string rootId = "30fb4cbe6eb2202b9e7b4a4fcc3dd2b6";
|
||||
|
||||
@@ -22,7 +22,6 @@ public class GeneralReceiveTest : IDisposable
|
||||
private const string streamId = "a3ac1b2706";S
|
||||
private const string rootId = "7d53bcf28c6696ecac8781684a0aa006";*/
|
||||
|
||||
|
||||
private const string url = "https://latest.speckle.systems/projects/2099ac4b5f/models/da511c4d1e"; //perf?
|
||||
private readonly Uri _baseUrl = new("https://latest.speckle.systems");
|
||||
private const string streamId = "2099ac4b5f";
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<ProjectReference Include="..\..\src\Speckle.Objects\Speckle.Objects.csproj" />
|
||||
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.1.0-dev.133"/> -->
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.1.0-dev.109"/> -->
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.0.0-dev.51"/> <!–Pre-optimisation–>-->
|
||||
</ItemGroup>
|
||||
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.1.0-dev.133"/> -->
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.1.0-dev.109"/> -->
|
||||
<!-- <PackageReference Include="Speckle.Objects" VersionOverride="3.0.0-dev.51"/> <!–Pre-optimisation–>-->
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -37,16 +37,15 @@ public sealed class GraphQLClientTests : IDisposable
|
||||
{
|
||||
var tokenSource = new CancellationTokenSource();
|
||||
tokenSource.Cancel();
|
||||
await _client.ExecuteWithResiliencePolicies(
|
||||
async () =>
|
||||
await Task.Run(
|
||||
async () =>
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
return "foo";
|
||||
},
|
||||
tokenSource.Token
|
||||
)
|
||||
await _client.ExecuteWithResiliencePolicies(async () =>
|
||||
await Task.Run(
|
||||
async () =>
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
return "foo";
|
||||
},
|
||||
tokenSource.Token
|
||||
)
|
||||
);
|
||||
});
|
||||
timer.Stop();
|
||||
|
||||
@@ -24,12 +24,11 @@ public class GraphQLErrorHandlerTests
|
||||
[MemberData(nameof(ErrorCases))]
|
||||
public void TestExceptionThrowingFromGraphQLErrors(Type exType, Map extensions)
|
||||
{
|
||||
var ex = Assert.Throws<AggregateException>(
|
||||
() =>
|
||||
new GraphQLResponse<GraphQLClientTests.FakeGqlResponseModel>
|
||||
{
|
||||
Errors = [new() { Extensions = extensions }],
|
||||
}.EnsureGraphQLSuccess()
|
||||
var ex = Assert.Throws<AggregateException>(() =>
|
||||
new GraphQLResponse<GraphQLClientTests.FakeGqlResponseModel>
|
||||
{
|
||||
Errors = [new() { Extensions = extensions }],
|
||||
}.EnsureGraphQLSuccess()
|
||||
);
|
||||
ex.InnerExceptions.Count.Should().Be(1);
|
||||
ex.InnerExceptions[0].Should().BeOfType(exType);
|
||||
|
||||
@@ -36,8 +36,7 @@ public class SpeckleHttpTests : MoqTest
|
||||
|
||||
var uri = new Uri("https://speckle.xyz");
|
||||
mockHttp.When(uri.AbsoluteUri).Respond(HttpStatusCode.Unauthorized);
|
||||
await Assert.ThrowsAsync<HttpRequestException>(
|
||||
async () => await speckleHttp.HttpPing(uri, mockHttp.ToHttpClient())
|
||||
await Assert.ThrowsAsync<HttpRequestException>(async () => await speckleHttp.HttpPing(uri, mockHttp.ToHttpClient())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ public class SqLiteJsonCacheExceptionTests
|
||||
public void ExpectedExceptionFires_Void()
|
||||
{
|
||||
using var pool = new CacheDbCommandPool("DataSource=:memory:", 1);
|
||||
Assert.Throws<SqLiteJsonCacheException>(
|
||||
() => pool.Use(CacheOperation.Get, new Action<SqliteCommand>(_ => throw new SqliteException("test", 1, 1)))
|
||||
Assert.Throws<SqLiteJsonCacheException>(() =>
|
||||
pool.Use(CacheOperation.Get, new Action<SqliteCommand>(_ => throw new SqliteException("test", 1, 1)))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ public class SqLiteJsonCacheExceptionTests
|
||||
public void ExpectedExceptionFires_Return()
|
||||
{
|
||||
using var pool = new CacheDbCommandPool("DataSource=:memory:", 1);
|
||||
Assert.Throws<SqLiteJsonCacheException>(
|
||||
() => pool.Use(CacheOperation.Get, new Func<SqliteCommand, bool>(_ => throw new SqliteException("test", 1, 1)))
|
||||
Assert.Throws<SqLiteJsonCacheException>(() =>
|
||||
pool.Use(CacheOperation.Get, new Func<SqliteCommand, bool>(_ => throw new SqliteException("test", 1, 1)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<PolySharpExcludeGeneratedTypes>System.Runtime.CompilerServices.IsExternalInit;System.Runtime.CompilerServices.RequiresLocationAttribute</PolySharpExcludeGeneratedTypes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="altcover" />
|
||||
<PackageReference Include="AwesomeAssertions" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="RichardSzalay.MockHttp" />
|
||||
<PackageReference Include="Speckle.DoubleNumerics" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" VersionOverride="8.0.0" />
|
||||
<PackageReference Include="xunit.assert" />
|
||||
<PackageReference Include="xunit.runner.visualstudio"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Speckle.Sdk\Speckle.Sdk.csproj" />
|
||||
<ProjectReference Include="..\Speckle.Sdk.Testing\Speckle.Sdk.Testing.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user