diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 994873bd..0f821550 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.29.2", + "version": "0.30.1", "commands": [ "dotnet-csharpier" ], diff --git a/src/Speckle.Objects/Geometry/Arc.cs b/src/Speckle.Objects/Geometry/Arc.cs index 2add9143..6cb3fd20 100644 --- a/src/Speckle.Objects/Geometry/Arc.cs +++ b/src/Speckle.Objects/Geometry/Arc.cs @@ -94,16 +94,15 @@ public bool TransformTo(Transform transform, out Arc transformed) midPoint.TransformTo(transform, out Point transformedMidpoint); endPoint.TransformTo(transform, out Point transformedEndPoint); plane.TransformTo(transform, out Plane pln); - Arc arc = - new() - { - startPoint = transformedStartPoint, - endPoint = transformedEndPoint, - midPoint = transformedMidpoint, - plane = pln, - domain = domain, - units = units, - }; + Arc arc = new() + { + startPoint = transformedStartPoint, + endPoint = transformedEndPoint, + midPoint = transformedMidpoint, + plane = pln, + domain = domain, + units = units, + }; transformed = arc; return true; } @@ -150,16 +149,15 @@ public List ToList() public static Arc FromList(List list) { string units = Units.GetUnitFromEncoding(list[^1]); - Arc arc = - new() - { - domain = new Interval { start = list[6], end = list[7] }, - units = units, - plane = Plane.FromList(list.GetRange(8, 13)), - startPoint = Point.FromList(list.GetRange(21, 3), units), - midPoint = Point.FromList(list.GetRange(24, 3), units), - endPoint = Point.FromList(list.GetRange(27, 3), units), - }; + Arc arc = new() + { + domain = new Interval { start = list[6], end = list[7] }, + units = units, + plane = Plane.FromList(list.GetRange(8, 13)), + startPoint = Point.FromList(list.GetRange(21, 3), units), + midPoint = Point.FromList(list.GetRange(24, 3), units), + endPoint = Point.FromList(list.GetRange(27, 3), units), + }; arc.plane.units = arc.units; return arc; diff --git a/src/Speckle.Objects/Geometry/Polycurve.cs b/src/Speckle.Objects/Geometry/Polycurve.cs index 501cdcea..d081b651 100644 --- a/src/Speckle.Objects/Geometry/Polycurve.cs +++ b/src/Speckle.Objects/Geometry/Polycurve.cs @@ -79,17 +79,16 @@ public bool TransformTo(Transform transform, out ITransformable polycurve) /// A with the same shape as the provided polyline. public static implicit operator Polycurve(Polyline polyline) { - Polycurve polycurve = - new() - { - segments = new(), - units = polyline.units, - area = polyline.area, - domain = polyline.domain, - closed = polyline.closed, - bbox = polyline.bbox, - length = polyline.length, - }; + Polycurve polycurve = new() + { + segments = new(), + units = polyline.units, + area = polyline.area, + domain = polyline.domain, + closed = polyline.closed, + bbox = polyline.bbox, + length = polyline.length, + }; var points = polyline.GetPoints(); for (var i = 0; i < points.Count - 1; i++) diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs index fa66482b..7f173ca9 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs @@ -71,18 +71,17 @@ query CommentThreads($projectId: String!, $commentId: String!, $repliesLimit: In } """; - GraphQLRequest request = - new() + GraphQLRequest request = new() + { + Query = QUERY, + Variables = new { - Query = QUERY, - Variables = new - { - commentId, - projectId, - repliesLimit, - repliesCursor, - }, - }; + commentId, + projectId, + repliesLimit, + repliesCursor, + }, + }; var response = await _client .ExecuteGraphQLRequest>>(request, cancellationToken) @@ -157,20 +156,19 @@ query CommentThreads($projectId: String!, $cursor: String, $limit: Int!, $filter } """; - GraphQLRequest request = - new() + GraphQLRequest request = new() + { + Query = QUERY, + Variables = new { - Query = QUERY, - Variables = new - { - projectId, - cursor, - limit, - filter, - repliesLimit, - repliesCursor, - }, - }; + projectId, + cursor, + limit, + filter, + repliesLimit, + repliesCursor, + }, + }; var response = await _client .ExecuteGraphQLRequest>>(request, cancellationToken) diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs index 4d4a01ab..87607ee8 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs @@ -185,18 +185,17 @@ query ProjectGetWithModels($projectId: String!, $modelsLimit: Int!, $modelsCurso } } """; - GraphQLRequest request = - new() + GraphQLRequest request = new() + { + Query = QUERY, + Variables = new { - Query = QUERY, - Variables = new - { - projectId, - modelsLimit, - modelsCursor, - modelsFilter, - }, - }; + projectId, + modelsLimit, + modelsCursor, + modelsFilter, + }, + }; var response = await _client .ExecuteGraphQLRequest>>>(request, cancellationToken) diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs index 4e6d1b66..0a09b644 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs @@ -94,18 +94,17 @@ query ProjectGetWithModels($projectId: String!, $modelsLimit: Int!, $modelsCurso } } """; - GraphQLRequest request = - new() + GraphQLRequest request = new() + { + Query = QUERY, + Variables = new { - Query = QUERY, - Variables = new - { - projectId, - modelsLimit, - modelsCursor, - modelsFilter, - }, - }; + projectId, + modelsLimit, + modelsCursor, + modelsFilter, + }, + }; var response = await _client .ExecuteGraphQLRequest>(request, cancellationToken) diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs index c907aa85..b06743bb 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs @@ -101,19 +101,18 @@ query VersionGetVersions($projectId: String!, $modelId: String!, $limit: Int!, $ } """; - GraphQLRequest request = - new() + GraphQLRequest request = new() + { + Query = QUERY, + Variables = new { - Query = QUERY, - Variables = new - { - projectId, - modelId, - limit, - cursor, - filter, - }, - }; + projectId, + modelId, + limit, + cursor, + filter, + }, + }; var response = await _client .ExecuteGraphQLRequest>>>>( diff --git a/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs b/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs index da5e64b7..5e87794b 100644 --- a/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs +++ b/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs @@ -119,14 +119,13 @@ CancellationToken cancellationToken } // Setup Serializer - SpeckleObjectDeserializer serializer = - new() - { - ReadTransport = localTransport, - OnProgressAction = internalProgressAction, - CancellationToken = cancellationToken, - BlobStorageFolder = (remoteTransport as IBlobCapableTransport)?.BlobStorageFolder, - }; + SpeckleObjectDeserializer serializer = new() + { + ReadTransport = localTransport, + OnProgressAction = internalProgressAction, + CancellationToken = cancellationToken, + BlobStorageFolder = (remoteTransport as IBlobCapableTransport)?.BlobStorageFolder, + }; // Try Local Receive string? objString = await LocalReceive(objectId, localTransport).ConfigureAwait(false); diff --git a/src/Speckle.Sdk/Common/Units.cs b/src/Speckle.Sdk/Common/Units.cs index 03880253..e6d4c854 100644 --- a/src/Speckle.Sdk/Common/Units.cs +++ b/src/Speckle.Sdk/Common/Units.cs @@ -19,8 +19,18 @@ public static class Units /// US Survey foot, now not supported by Speckle, kept privately for backwards compatibility private const string USFeet = "us_ft"; - internal static readonly List SupportedUnits = - new() { Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Yards, Miles, None }; + internal static readonly List SupportedUnits = new() + { + Millimeters, + Centimeters, + Meters, + Kilometers, + Inches, + Feet, + Yards, + Miles, + None, + }; /// /// if is a recognised/supported unit string, otherwise diff --git a/src/Speckle.Sdk/Serialisation/SpeckleObjectSerializer.cs b/src/Speckle.Sdk/Serialisation/SpeckleObjectSerializer.cs index b08e2a33..123f60d7 100644 --- a/src/Speckle.Sdk/Serialisation/SpeckleObjectSerializer.cs +++ b/src/Speckle.Sdk/Serialisation/SpeckleObjectSerializer.cs @@ -131,13 +131,12 @@ private void SerializeProperty( // Note: this change was needed as we've made the ObjectReference type inherit from Base for // the purpose of the "do not convert unchanged previously converted objects" POC. case ObjectReference r: - Dictionary ret = - new() - { - ["speckle_type"] = r.speckle_type, - ["referencedId"] = r.referencedId, - ["__closure"] = r.closure, - }; + Dictionary ret = new() + { + ["speckle_type"] = r.speckle_type, + ["referencedId"] = r.referencedId, + ["__closure"] = r.closure, + }; if (r.closure is not null) { foreach (var kvp in r.closure) @@ -301,8 +300,9 @@ private void SerializeProperty( IReadOnlyCollection dynamicProperties = baseObj.DynamicPropertyKeys; // propertyName -> (originalValue, isDetachable, isChunkable, chunkSize) - Dictionary allProperties = - new(typedProperties.Count + dynamicProperties.Count); + Dictionary allProperties = new( + typedProperties.Count + dynamicProperties.Count + ); // Construct `allProperties`: Add typed properties foreach ((PropertyInfo propertyInfo, PropertyAttributeInfo detachInfo) in typedProperties) diff --git a/src/Speckle.Sdk/Serialisation/V2/Send/ObjectSerializer.cs b/src/Speckle.Sdk/Serialisation/V2/Send/ObjectSerializer.cs index cd1b28c8..f85cf318 100644 --- a/src/Speckle.Sdk/Serialisation/V2/Send/ObjectSerializer.cs +++ b/src/Speckle.Sdk/Serialisation/V2/Send/ObjectSerializer.cs @@ -100,20 +100,12 @@ private void SerializeProperty(object? obj, JsonWriter writer, PropertyAttribute // Note: this change was needed as we've made the ObjectReference type inherit from Base for // the purpose of the send object (connector/conversion level) caching. case ObjectReference r: - Dictionary ret = - new() - { - ["speckle_type"] = r.speckle_type, - ["referencedId"] = r.referencedId, - ["__closure"] = r.closure, - }; - //references can be externally provided and need to know the ids in the closure and reference here - //AddClosure can take the same value twice - foreach (var kvp in r.closure.Empty()) + Dictionary ret = new() { - AddClosure(kvp.Key); - } - AddClosure(r.referencedId); + ["speckle_type"] = r.speckle_type, + ["referencedId"] = r.referencedId, + ["__closure"] = r.closure, + }; SerializeProperty(ret, writer); break; case Base b: diff --git a/src/Speckle.Sdk/Serialisation/V2/ServerObjectManager.cs b/src/Speckle.Sdk/Serialisation/V2/ServerObjectManager.cs index f21ee85c..d5833868 100644 --- a/src/Speckle.Sdk/Serialisation/V2/ServerObjectManager.cs +++ b/src/Speckle.Sdk/Serialisation/V2/ServerObjectManager.cs @@ -175,8 +175,11 @@ CancellationToken cancellationToken { cancellationToken.ThrowIfCancellationRequested(); - using HttpRequestMessage message = - new() { RequestUri = new Uri($"/objects/{_streamId}", UriKind.Relative), Method = HttpMethod.Post }; + using HttpRequestMessage message = new() + { + RequestUri = new Uri($"/objects/{_streamId}", UriKind.Relative), + Method = HttpMethod.Post, + }; MultipartFormDataContent multipart = new(); diff --git a/src/Speckle.Sdk/Transports/ServerTransport.cs b/src/Speckle.Sdk/Transports/ServerTransport.cs index 8665ca1a..abfa0e61 100644 --- a/src/Speckle.Sdk/Transports/ServerTransport.cs +++ b/src/Speckle.Sdk/Transports/ServerTransport.cs @@ -129,8 +129,14 @@ public async Task CopyObjectAndChildren(string id, ITransport targetTran CancellationToken.ThrowIfCancellationRequested(); - using ParallelServerApi api = - new(_http, _activityFactory, BaseUri, AuthorizationToken, BlobStorageFolder, TimeoutSeconds); + using ParallelServerApi api = new( + _http, + _activityFactory, + BaseUri, + AuthorizationToken, + BlobStorageFolder, + TimeoutSeconds + ); var stopwatch = Stopwatch.StartNew(); api.CancellationToken = CancellationToken; diff --git a/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs b/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs index 0632e9fd..68ac2a74 100644 --- a/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs +++ b/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs @@ -392,8 +392,11 @@ private async Task UploadObjectsImpl( { CancellationToken.ThrowIfCancellationRequested(); - using HttpRequestMessage message = - new() { RequestUri = new Uri($"/objects/{streamId}", UriKind.Relative), Method = HttpMethod.Post }; + using HttpRequestMessage message = new() + { + RequestUri = new Uri($"/objects/{streamId}", UriKind.Relative), + Method = HttpMethod.Post, + }; MultipartFormDataContent multipart = new(); diff --git a/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs b/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs index 5820a071..7cb8639b 100644 --- a/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs +++ b/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs @@ -33,35 +33,34 @@ public void Setup() /// (or is an interface where all concrete types are supported) /// You should also consider adding a test in SerializerNonBreakingChanges /// - private static readonly HashSet _allowedTypes = - new() - { - typeof(Boolean), - typeof(Byte), - typeof(UInt32), - typeof(UInt64), - typeof(Int16), - typeof(Int32), - typeof(Int64), - //typeof(Half), - typeof(Single), - typeof(Double), - typeof(Char), - typeof(string), - typeof(DateTime), - typeof(Guid), - typeof(Color), - typeof(List<>), - typeof(Nullable<>), - typeof(IList<>), - typeof(IReadOnlyList<>), - typeof(Dictionary<,>), - //typeof(IDictionary<,>), - //typeof(IReadOnlyDictionary<,>), - typeof(ICurve), - typeof(Object), - typeof(Matrix4x4), - }; + private static readonly HashSet _allowedTypes = new() + { + typeof(Boolean), + typeof(Byte), + typeof(UInt32), + typeof(UInt64), + typeof(Int16), + typeof(Int32), + typeof(Int64), + //typeof(Half), + typeof(Single), + typeof(Double), + typeof(Char), + typeof(string), + typeof(DateTime), + typeof(Guid), + typeof(Color), + typeof(List<>), + typeof(Nullable<>), + typeof(IList<>), + typeof(IReadOnlyList<>), + typeof(Dictionary<,>), + //typeof(IDictionary<,>), + //typeof(IReadOnlyDictionary<,>), + typeof(ICurve), + typeof(Object), + typeof(Matrix4x4), + }; [Test] public void TestObjects() diff --git a/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs b/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs index cd8eda28..c7582df0 100644 --- a/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs @@ -23,13 +23,12 @@ public void PolygonTest([Range(3, 9)] int n, [Values] bool planar) List faces = new(n + 1) { n }; faces.AddRange(Enumerable.Range(0, n)); - Mesh mesh = - new() - { - vertices = vertices, - faces = faces, - units = Units.Meters, - }; + Mesh mesh = new() + { + vertices = vertices, + faces = faces, + units = Units.Meters, + }; //Test mesh.TriangulateMesh(); @@ -59,13 +58,12 @@ public void DoesntFlipNormals() List faces = new() { 3, 0, 1, 2 }; - Mesh mesh = - new() - { - vertices = vertices, - faces = new List(faces), - units = Units.Meters, - }; + Mesh mesh = new() + { + vertices = vertices, + faces = new List(faces), + units = Units.Meters, + }; //Test mesh.TriangulateMesh(); @@ -87,13 +85,12 @@ public void PreserveQuads([Values] bool preserveQuads) List faces = new() { 4, 0, 1, 2, 3 }; - Mesh mesh = - new() - { - vertices = vertices, - faces = new List(faces), - units = Units.Meters, - }; + Mesh mesh = new() + { + vertices = vertices, + faces = new List(faces), + units = Units.Meters, + }; //Tests mesh.TriangulateMesh(preserveQuads); diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs index 78d2cae3..ffb294de 100644 --- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs @@ -35,8 +35,11 @@ public async Task Setup() [Test] public void ProjectCreate_WithoutAuth() { - ProjectCreateInput input = - new("The best project", "The best description for the best project", ProjectVisibility.Private); + ProjectCreateInput input = new( + "The best project", + "The best description for the best project", + ProjectVisibility.Private + ); var ex = Assert.ThrowsAsync(async () => _ = await _unauthedUser.Project.Create(input)); Assert.That(ex?.InnerExceptions, Has.One.Items.And.All.TypeOf()); diff --git a/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs b/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs index ba50fffd..9b8e293c 100644 --- a/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs @@ -52,13 +52,12 @@ public static async Task CreateVersion(Client client, string projectId, public static async Task SeedUser() { var seed = Guid.NewGuid().ToString().ToLower(); - Dictionary user = - new() - { - ["email"] = $"{seed.Substring(0, 7)}@example.com", - ["password"] = "12ABC3456789DEF0GHO", - ["name"] = $"{seed.Substring(0, 5)} Name", - }; + Dictionary user = new() + { + ["email"] = $"{seed.Substring(0, 7)}@example.com", + ["password"] = "12ABC3456789DEF0GHO", + ["name"] = $"{seed.Substring(0, 5)} Name", + }; using var httpClient = new HttpClient( new HttpClientHandler { AllowAutoRedirect = false, CheckCertificateRevocationList = true } @@ -85,14 +84,13 @@ public static async Task SeedUser() var query = HttpUtility.ParseQueryString(uri.Query); string accessCode = query["access_code"] ?? throw new Exception("Redirect Uri has no 'access_code'."); - Dictionary tokenBody = - new() - { - ["accessCode"] = accessCode, - ["appId"] = "spklwebapp", - ["appSecret"] = "spklwebapp", - ["challenge"] = "challengingchallenge", - }; + Dictionary tokenBody = new() + { + ["accessCode"] = accessCode, + ["appId"] = "spklwebapp", + ["appSecret"] = "spklwebapp", + ["challenge"] = "challengingchallenge", + }; var tokenResponse = await httpClient.PostAsync( "/auth/token", diff --git a/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs index 403e631a..4f200fae 100644 --- a/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs @@ -36,13 +36,12 @@ public void Traverse_TraversesListMembers() var expectTraverse = new Base { id = "List Member" }; var expectIgnored = new Base { id = "Not List Member" }; - TraversalMock testCase = - new() - { - ListChildren = new List { expectTraverse }, - DictChildren = new Dictionary { ["myprop"] = expectIgnored }, - Child = expectIgnored, - }; + TraversalMock testCase = new() + { + ListChildren = new List { expectTraverse }, + DictChildren = new Dictionary { ["myprop"] = expectIgnored }, + Child = expectIgnored, + }; var ret = Traverse(testCase, traverseListsRule).Select(b => b.Current).ToList(); @@ -68,13 +67,12 @@ public void Traverse_TraversesDictMembers() var expectTraverse = new Base { id = "Dict Member" }; var expectIgnored = new Base { id = "Not Dict Member" }; - TraversalMock testCase = - new() - { - ListChildren = new List { expectIgnored }, - DictChildren = new Dictionary { ["myprop"] = expectTraverse }, - Child = expectIgnored, - }; + TraversalMock testCase = new() + { + ListChildren = new List { expectIgnored }, + DictChildren = new Dictionary { ["myprop"] = expectTraverse }, + Child = expectIgnored, + }; var ret = Traverse(testCase, traverseListsRule).Select(b => b.Current).ToList(); @@ -98,13 +96,12 @@ public void Traverse_TraversesDynamic() var expectTraverse = new Base { id = "List Member" }; var expectIgnored = new Base { id = "Not List Member" }; - TraversalMock testCase = - new() - { - Child = expectIgnored, - ["dynamicChild"] = expectTraverse, - ["dynamicListChild"] = new List { expectTraverse }, - }; + TraversalMock testCase = new() + { + Child = expectIgnored, + ["dynamicChild"] = expectTraverse, + ["dynamicListChild"] = new List { expectTraverse }, + }; var ret = Traverse(testCase, traverseListsRule).Select(b => b.Current).ToList(); @@ -128,13 +125,12 @@ public void Traverse_ExclusiveRule() .When(_ => true) .ContinueTraversing(x => x.GetMembers(DynamicBaseMemberType.Dynamic).Select(kvp => kvp.Key)); - TraversalMock testCase = - new() - { - Child = expectIgnored, - ["dynamicChild"] = expectTraverse, - ["dynamicListChild"] = new List { expectTraverse }, - }; + TraversalMock testCase = new() + { + Child = expectIgnored, + ["dynamicChild"] = expectTraverse, + ["dynamicListChild"] = new List { expectTraverse }, + }; var ret = Traverse(testCase, traverseListsRule).Select(b => b.Current).ToList(); diff --git a/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs index f36325ec..2144f020 100644 --- a/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs @@ -11,20 +11,19 @@ public class TraversalTests public void TestFlattenWithBreaker() { //Setup - Base root = - new() + Base root = new() + { + id = "root", + ["child"] = new Base { - id = "root", + id = "traverse through me", ["child"] = new Base { - id = "traverse through me", - ["child"] = new Base - { - id = "break on me, go no further", - ["child"] = new Base { id = "should have ignored me" }, - }, + id = "break on me, go no further", + ["child"] = new Base { id = "should have ignored me" }, }, - }; + }, + }; static bool BreakRule(Base b) => b.id.Contains("break on me"); diff --git a/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransport2Tests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransport2Tests.cs index 737fbfac..f61009ab 100644 --- a/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransport2Tests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransport2Tests.cs @@ -99,14 +99,13 @@ public void UpdateObject_WhileEnumerating() { //I question if this is the behaviour we want, but AccountManager.GetObjects is relying on being able to update objects while enumerating over them const string UPDATE_STRING = "_new"; - Dictionary testData = - new() - { - { "a", "This is object a" }, - { "b", "This is object b" }, - { "c", "This is object c" }, - { "d", "This is object d" }, - }; + Dictionary testData = new() + { + { "a", "This is object a" }, + { "b", "This is object b" }, + { "c", "This is object c" }, + { "d", "This is object d" }, + }; int length = testData.Values.First().Length; foreach (var (key, data) in testData) diff --git a/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs index ddd48923..5393730d 100644 --- a/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs @@ -98,14 +98,13 @@ public void UpdateObject_WhileEnumerating() { //I question if this is the behaviour we want, but AccountManager.GetObjects is relying on being able to update objects while enumerating over them const string UPDATE_STRING = "_new"; - Dictionary testData = - new() - { - { "a", "This is object a" }, - { "b", "This is object b" }, - { "c", "This is object c" }, - { "d", "This is object d" }, - }; + Dictionary testData = new() + { + { "a", "This is object a" }, + { "b", "This is object b" }, + { "c", "This is object c" }, + { "d", "This is object d" }, + }; int length = testData.Values.First().Length; foreach (var (key, data) in testData)