Skip to content

Commit f74282e

Browse files
committed
Run code cleanup
1 parent a3e77fd commit f74282e

90 files changed

Lines changed: 1092 additions & 810 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/Deserialize/CustomObjects/ChildClassTests.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Amazon.DynamoDBv2.Model;
22
using DynamoDBGenerator.Attributes;
3+
34
namespace DynamoDBGenerator.SourceGenerator.Tests.DynamoDBDocumentTests.Deserialize.CustomObjects;
45

56
[DynamoDBMarshaller(EntityType = typeof(ParentClass))]
@@ -10,20 +11,22 @@ public void Deserialize_AllFieldsSet_AllIncluded()
1011
{
1112
var result = ParentClassMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
1213
{
13-
{nameof(ParentClass.Id), new AttributeValue {S = "I am the root"}},
14+
{ nameof(ParentClass.Id), new AttributeValue { S = "I am the root" } },
1415
{
1516
nameof(ParentClass.CustomClass), new AttributeValue
1617
{
1718
M = new Dictionary<string, AttributeValue>
1819
{
19-
20-
{nameof(ParentClass.CustomClass.PropertyId), new AttributeValue {S = "I am the property"}},
20+
{ nameof(ParentClass.CustomClass.PropertyId), new AttributeValue { S = "I am the property" } },
2121
{
2222
nameof(ParentClass.CustomClass.GrandChild), new AttributeValue
2323
{
2424
M = new Dictionary<string, AttributeValue>
2525
{
26-
{nameof(ParentClass.ChildClass.GrandChildClass.GrandChildId), new AttributeValue {S = "I am the grandchild id"}}
26+
{
27+
nameof(ParentClass.ChildClass.GrandChildClass.GrandChildId),
28+
new AttributeValue { S = "I am the grandchild id" }
29+
}
2730
}
2831
}
2932
}
@@ -44,7 +47,7 @@ public void Deserialize_ChildClass_NotIncluded()
4447
{
4548
var result = ParentClassMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
4649
{
47-
{nameof(ParentClass.Id), new AttributeValue {S = "I am the root"}},
50+
{ nameof(ParentClass.Id), new AttributeValue { S = "I am the root" } }
4851
});
4952

5053
result.Id.Should().Be("I am the root");
@@ -56,7 +59,7 @@ public void Deserialize_ChildClassField_NotIncluded()
5659
{
5760
var result = ParentClassMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
5861
{
59-
{nameof(ParentClass.Id), new AttributeValue {S = "I am the root"}},
62+
{ nameof(ParentClass.Id), new AttributeValue { S = "I am the root" } },
6063
{
6164
nameof(ParentClass.CustomClass), new AttributeValue
6265
{
@@ -76,14 +79,13 @@ public void Deserialize_GrandChildClass_NotIncluded()
7679
{
7780
var result = ParentClassMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
7881
{
79-
{nameof(ParentClass.Id), new AttributeValue {S = "I am the root"}},
82+
{ nameof(ParentClass.Id), new AttributeValue { S = "I am the root" } },
8083
{
8184
nameof(ParentClass.CustomClass), new AttributeValue
8285
{
8386
M = new Dictionary<string, AttributeValue>
8487
{
85-
86-
{nameof(ParentClass.CustomClass.PropertyId), new AttributeValue {S = "I am the property"}}
88+
{ nameof(ParentClass.CustomClass.PropertyId), new AttributeValue { S = "I am the property" } }
8789
}
8890
}
8991
}
@@ -100,14 +102,13 @@ public void Deserialize_GrandChildClassField_NotIncluded()
100102
{
101103
var result = ParentClassMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
102104
{
103-
{nameof(ParentClass.Id), new AttributeValue {S = "I am the root"}},
105+
{ nameof(ParentClass.Id), new AttributeValue { S = "I am the root" } },
104106
{
105107
nameof(ParentClass.CustomClass), new AttributeValue
106108
{
107109
M = new Dictionary<string, AttributeValue>
108110
{
109-
110-
{nameof(ParentClass.CustomClass.PropertyId), new AttributeValue {S = "I am the property"}},
111+
{ nameof(ParentClass.CustomClass.PropertyId), new AttributeValue { S = "I am the property" } },
111112
{
112113
nameof(ParentClass.CustomClass.GrandChild), new AttributeValue()
113114
}
@@ -139,4 +140,4 @@ public class GrandChildClass
139140
public string? GrandChildId { get; set; }
140141
}
141142
}
142-
}
143+
}

tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/Deserialize/CustomObjects/SiblingClasstests.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Amazon.DynamoDBv2.Model;
22
using DynamoDBGenerator.Attributes;
3+
34
namespace DynamoDBGenerator.SourceGenerator.Tests.DynamoDBDocumentTests.Deserialize.CustomObjects;
45

56
[DynamoDBMarshaller(EntityType = typeof(SiblingClassOne))]
@@ -10,22 +11,22 @@ public void Serialize_AllFieldsSet_AllIncluded()
1011
{
1112
var result = SiblingClassOneMarshaller
1213
.Unmarshall(new Dictionary<string, AttributeValue>
13-
{
14-
{nameof(SiblingClassOne.Id), new AttributeValue {S = "I am the root"}},
15-
1614
{
17-
nameof(SiblingClassOne.CustomClass), new AttributeValue
15+
{ nameof(SiblingClassOne.Id), new AttributeValue { S = "I am the root" } },
16+
1817
{
19-
M = new Dictionary<string, AttributeValue>
18+
nameof(SiblingClassOne.CustomClass), new AttributeValue
2019
{
20+
M = new Dictionary<string, AttributeValue>
2121
{
22-
nameof(SiblingClassOne.CustomClass.PropertyId), new AttributeValue
23-
{S = "I am the property"}
22+
{
23+
nameof(SiblingClassOne.CustomClass.PropertyId), new AttributeValue
24+
{ S = "I am the property" }
25+
}
2426
}
2527
}
2628
}
27-
}
28-
});
29+
});
2930

3031
result.Id.Should().Be("I am the root");
3132
result.CustomClass.Should().NotBeNull();
@@ -35,11 +36,9 @@ public void Serialize_AllFieldsSet_AllIncluded()
3536
[Fact]
3637
public void Serialize_CustomProperty_NotIncluded()
3738
{
38-
3939
var result = SiblingClassOneMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
4040
{
41-
{nameof(SiblingClassOne.Id), new AttributeValue {S = "I am the root"}}
42-
41+
{ nameof(SiblingClassOne.Id), new AttributeValue { S = "I am the root" } }
4342
});
4443

4544
result.Id.Should().Be("I am the root");
@@ -49,10 +48,9 @@ public void Serialize_CustomProperty_NotIncluded()
4948
[Fact]
5049
public void Serialize_CustomPropertyField_NotIncluded()
5150
{
52-
5351
var result = SiblingClassOneMarshaller.Unmarshall(new Dictionary<string, AttributeValue>
5452
{
55-
{nameof(SiblingClassOne.Id), new AttributeValue {S = "I am the root"}},
53+
{ nameof(SiblingClassOne.Id), new AttributeValue { S = "I am the root" } },
5654

5755
{
5856
nameof(SiblingClassOne.CustomClass), new AttributeValue
@@ -77,4 +75,4 @@ public class SiblingClassOne
7775
public class SiblingClassTwo
7876
{
7977
public string? PropertyId { get; set; }
80-
}
78+
}

tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/Deserialize/Generics/DictionaryTests.cs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Amazon.DynamoDBv2.Model;
22
using DynamoDBGenerator.Attributes;
3+
34
namespace DynamoDBGenerator.SourceGenerator.Tests.DynamoDBDocumentTests.Deserialize.Generics;
45

56
[DynamoDBMarshaller(EntityType = typeof(DictionaryClass))]
@@ -20,9 +21,8 @@ public void Deserialize_CustomValuedDictionary_ShouldContainCorrectKeyValues()
2021
{
2122
M = new Dictionary<string, AttributeValue>
2223
{
23-
24-
{"Name", new AttributeValue {S = "John"}},
25-
{"SomethingElse", new AttributeValue {S = "FooBar"}}
24+
{ "Name", new AttributeValue { S = "John" } },
25+
{ "SomethingElse", new AttributeValue { S = "FooBar" } }
2626
}
2727
}
2828
},
@@ -31,9 +31,8 @@ public void Deserialize_CustomValuedDictionary_ShouldContainCorrectKeyValues()
3131
{
3232
M = new Dictionary<string, AttributeValue>
3333
{
34-
35-
{"Name", new AttributeValue {S = "John2"}},
36-
{"SomethingElse", new AttributeValue {S = "FooBar2"}}
34+
{ "Name", new AttributeValue { S = "John2" } },
35+
{ "SomethingElse", new AttributeValue { S = "FooBar2" } }
3736
}
3837
}
3938
}
@@ -60,6 +59,7 @@ public void Deserialize_CustomValuedDictionary_ShouldContainCorrectKeyValues()
6059
}
6160
);
6261
}
62+
6363
[Fact]
6464
public void Deserialize_Dictionary_ShouldContainCorrectKeyValues()
6565
{
@@ -70,8 +70,8 @@ public void Deserialize_Dictionary_ShouldContainCorrectKeyValues()
7070
{
7171
M = new Dictionary<string, AttributeValue>
7272
{
73-
{"Two", new AttributeValue {N = "2"}},
74-
{"One", new AttributeValue {N = "1"}}
73+
{ "Two", new AttributeValue { N = "2" } },
74+
{ "One", new AttributeValue { N = "1" } }
7575
}
7676
}
7777
}
@@ -81,7 +81,8 @@ public void Deserialize_Dictionary_ShouldContainCorrectKeyValues()
8181
.BeOfType<Dictionary<string, int>>()
8282
.Which
8383
.Should()
84-
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)), x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
84+
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)),
85+
x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
8586
}
8687

8788
[Fact]
@@ -94,8 +95,8 @@ public void Deserialize_IReadOnlyDictionary_ShouldBeDictionaryAndContainCorrectK
9495
{
9596
M = new Dictionary<string, AttributeValue>
9697
{
97-
{"Two", new AttributeValue {N = "2"}},
98-
{"One", new AttributeValue {N = "1"}}
98+
{ "Two", new AttributeValue { N = "2" } },
99+
{ "One", new AttributeValue { N = "1" } }
99100
}
100101
}
101102
}
@@ -105,8 +106,10 @@ public void Deserialize_IReadOnlyDictionary_ShouldBeDictionaryAndContainCorrectK
105106
.BeOfType<Dictionary<string, int>>()
106107
.Which
107108
.Should()
108-
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)), x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
109+
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)),
110+
x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
109111
}
112+
110113
[Fact]
111114
public void Deserialize_IDictionary_ShouldBeDictionaryAndContainCorrectKeyValues()
112115
{
@@ -117,8 +120,8 @@ public void Deserialize_IDictionary_ShouldBeDictionaryAndContainCorrectKeyValues
117120
{
118121
M = new Dictionary<string, AttributeValue>
119122
{
120-
{"Two", new AttributeValue {N = "2"}},
121-
{"One", new AttributeValue {N = "1"}}
123+
{ "Two", new AttributeValue { N = "2" } },
124+
{ "One", new AttributeValue { N = "1" } }
122125
}
123126
}
124127
}
@@ -128,9 +131,9 @@ public void Deserialize_IDictionary_ShouldBeDictionaryAndContainCorrectKeyValues
128131
.BeOfType<Dictionary<string, int>>()
129132
.Which
130133
.Should()
131-
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)), x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
134+
.SatisfyRespectively(x => x.Should().Be(new KeyValuePair<string, int>("Two", 2)),
135+
x => x.Should().Be(new KeyValuePair<string, int>("One", 1)));
132136
}
133-
134137
}
135138

136139
public class DictionaryClass
@@ -151,4 +154,4 @@ public class CustomClass
151154
public string? Name { get; set; }
152155
public string? SomethingElse { get; set; }
153156
}
154-
}
157+
}

0 commit comments

Comments
 (0)