9
9
10
10
namespace Dynatello . Tests ;
11
11
12
- [ DynamoDBMarshaller ( typeof ( Cat ) , ArgumentType = typeof ( ( Guid Id , double MinimumCuteness ) ) ) ]
13
- public partial class ToQueryRequestTests
12
+ public class ToQueryRequestTests
14
13
{
15
14
private readonly Fixture _fixture = new ( ) ;
16
15
17
- public ToQueryRequestTests ( )
16
+ static ToQueryRequestTests ( )
18
17
{
19
- var withKeyConditionExpression = CatMarshaller
18
+ var withKeyConditionExpression = Cat . QueryWithCuteness
20
19
. OnTable ( "TABLE" )
21
20
. WithKeyConditionExpression ( ( x , y ) => $ "{ x . Id } = { y . Id } ") ;
22
- _queryCatWithId = withKeyConditionExpression . ToQueryRequestBuilder ( ) ;
21
+ QueryCatWithId = withKeyConditionExpression . ToQueryRequestBuilder ( ) ;
23
22
24
- _queryCatWithIdAndMinimumCuteness = withKeyConditionExpression
23
+ QueryCatWithIdAndMinimumCuteness = withKeyConditionExpression
25
24
. WithFilterExpression ( ( x , y ) => $ "{ x . Cuteness } > { y . MinimumCuteness } ")
26
25
. ToQueryRequestBuilder ( ) ;
27
26
}
28
27
29
- private readonly QueryRequestBuilder < ( Guid Id , double MinimumCuteness ) > _queryCatWithIdAndMinimumCuteness ;
30
- private readonly QueryRequestBuilder < ( Guid Id , double MinimumCuteness ) > _queryCatWithId ;
28
+ private static readonly QueryRequestBuilder < ( Guid Id , double MinimumCuteness ) > QueryCatWithIdAndMinimumCuteness ;
29
+ private static readonly QueryRequestBuilder < ( Guid Id , double MinimumCuteness ) > QueryCatWithId ;
31
30
32
31
[ Fact ]
33
32
public void Build_Request ( )
34
33
{
35
34
_fixture . CreateMany < ( Guid Id , double MinimumCuteness ) > ( 10 ) . Should ( ) . AllSatisfy ( tuple =>
36
35
{
37
- var request = _queryCatWithId . Build ( tuple ) ;
36
+ var request = QueryCatWithId . Build ( tuple ) ;
38
37
39
38
request . TableName . Should ( ) . Be ( "TABLE" ) ;
40
39
request . ExpressionAttributeNames . Should ( ) . BeEquivalentTo ( new Dictionary < string , string >
@@ -56,7 +55,7 @@ public void Build_Request_FilterExpression()
56
55
{
57
56
_fixture . CreateMany < ( Guid Id , double MinimumCuteness ) > ( 10 ) . Should ( ) . AllSatisfy ( tuple =>
58
57
{
59
- var request = _queryCatWithIdAndMinimumCuteness . Build ( tuple ) ;
58
+ var request = QueryCatWithIdAndMinimumCuteness . Build ( tuple ) ;
60
59
61
60
request . TableName . Should ( ) . Be ( "TABLE" ) ;
62
61
request . ExpressionAttributeNames . Should ( ) . BeEquivalentTo ( new Dictionary < string , string >
@@ -77,7 +76,8 @@ public void Build_Request_FilterExpression()
77
76
}
78
77
}
79
78
80
- public record Cat (
79
+ [ DynamoDBMarshaller ( typeof ( Cat ) , PropertyName = "QueryWithCuteness" , ArgumentType = typeof ( ( Guid Id , double MinimumCuteness ) ) ) ]
80
+ public readonly partial record struct Cat (
81
81
[ property: DynamoDBHashKey ] Guid Id ,
82
82
[ property: DynamoDBRangeKey ] Guid HomeId ,
83
83
string Name ,
0 commit comments