Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybibikov committed May 4, 2024
1 parent 49dbb0a commit 1d31839
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/Requests/ConditionCheckTransactionRequest`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public sealed class ConditionCheckTransactionRequest<T> : TransactionRequest
public ConditionCheckTransactionRequest(string keyValue)
: base(typeof(T))
{
var key = DynamoDbMapper.GetHashKeyAttributeName(typeof(T));
Initialize(new KeyValue { Key = key, Value = keyValue });
var keyNameAttributed = DynamoDbMapper.GetHashKeyAttributeName(typeof(T));
var keyAttribute = new AttributeValue { S = keyValue };
var key = new Dictionary<string, AttributeValue> { { keyNameAttributed, keyAttribute } };
Key = key;
}

public override Operation GetOperation()
Expand Down Expand Up @@ -81,11 +83,6 @@ private void AddCondition<TV, TValue>(Expression<Func<TV, TValue>> propertyExpre
ConditionExpression += $"{ConditionExpression} #{propertyName} {comparisonOperator} :{propertyName}Value AND ";
}

private void Initialize(KeyValue keyValue)
{
Key = GetKey(keyValue);
}

private string GetPropertyName<TV, TValue>(Expression<Func<TV, TValue>> expression)
{
string? propertyName = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
public class DynamoDbTransactorTests
{
private readonly Mock<ITransactionManager> _mockManager;
private DynamoDbTransactor _transactor;

public DynamoDbTransactorTests()
{
Expand Down

0 comments on commit 1d31839

Please sign in to comment.