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