public static async Task AssertItemAsync( this IAmazonDynamoDB db, string tableName, Dictionary <string, AttributeValue> key, Dictionary <string, AttributeValue> expectedItem ) { GetItemRequest request = new GetItemRequest { TableName = tableName, Key = key, ConsistentRead = true }; GetItemResponse response = await db .GetItemAsync(request) .ConfigureAwait(false); if (!response.IsItemSet) { Assert.Fail("Item should exist."); } AttributeValueAssert.AreEqual( actual: response.Item, expected: expectedItem ); }
public void AreEqual_Dictionary_WhenEquivalent( Dictionary <string, AttributeValue> x, Dictionary <string, AttributeValue> y ) { AttributeValueAssert.AreEqual(x, y); }
public void AreEqual_Null_WhenEqual([Values] bool value) { AttributeValueAssert.AreEqual( new AttributeValue { NULL = value }, new AttributeValue { NULL = value } ); }
public void AreEqual_Numeric_WhenEqual(byte[] bytes) { AttributeValueAssert.AreEqual( new AttributeValue { B = new MemoryStream(bytes) }, new AttributeValue { B = new MemoryStream(bytes) } ); }
public void AreEqual_Boolean_WhenEqual([Values] bool value) { AttributeValueAssert.AreEqual( new AttributeValue { BOOL = value }, new AttributeValue { BOOL = value } ); }
public void AreEqual_String_WhenEqual(string value) { AttributeValueAssert.AreEqual( new AttributeValue { S = value }, new AttributeValue { S = value } ); }
public void AreEqual_Numeric_WhenEqual(string value) { AttributeValueAssert.AreEqual( new AttributeValue { N = value }, new AttributeValue { N = value } ); }
public void AreEqual_BinarySet_WhenEquivalent( List <MemoryStream> x, List <MemoryStream> y ) { AttributeValueAssert.AreEqual( new AttributeValue { BS = x }, new AttributeValue { BS = y } ); }
public void AreEqual_Map_WhenEquivalent( Dictionary <string, AttributeValue> x, Dictionary <string, AttributeValue> y ) { AttributeValueAssert.AreEqual( new AttributeValue { M = x }, new AttributeValue { M = y } ); }
public void AreEqual_StringSet_WhenEquivalent( List <string> x, List <string> y ) { AttributeValueAssert.AreEqual( new AttributeValue { SS = x }, new AttributeValue { SS = y } ); }
public void AreEqual_List_WhenEquivalent( List <AttributeValue> x, List <AttributeValue> y ) { AttributeValueAssert.AreEqual( new AttributeValue { L = x }, new AttributeValue { L = y } ); }
public void AreEqual_Dictionary_WhenNotEqual( Dictionary <string, AttributeValue> x, Dictionary <string, AttributeValue> y, string expectedMessage ) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual(x, y); }); Assert.That( err.Message, Does.StartWith(expectedMessage) ); }
public void AreEqual_Null_WhenNotEqual() { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { NULL = true }, new AttributeValue { NULL = false } ); }); Assert.That( err.Message, Does.StartWith(" NULL must be equal") ); }
public void AreEqual_Numeric_WhenNotEqual(string x, string y) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { N = "33" }, new AttributeValue { N = "45" } ); }); Assert.That( err.Message, Does.StartWith(" N must be equal") ); }
public void AreEqual_String_WhenNotEqual() { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { S = "x" }, new AttributeValue { S = "y" } ); }); Assert.That( err.Message, Does.StartWith(" S must be equal") ); }
public void AreEqual_Boolean_WhenBooleanNotSet() { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { BOOL = true }, new AttributeValue { S = "abc" } ); }); Assert.That( err.Message, Does.StartWith(" IsBOOLSet must be equal") ); }
public void AreEqual_Numeric_WhenNotEqual( byte[] x, byte[] y ) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { B = new MemoryStream(x) }, new AttributeValue { B = new MemoryStream(y) } ); }); Assert.That( err.Message, Does.StartWith(" B must be equal") ); }
public void AreEqual_BinarySet_WhenNotEqual( List <MemoryStream> x, List <MemoryStream> y ) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { BS = x }, new AttributeValue { BS = y } ); }); Assert.That( err.Message, Does.StartWith(" BS must be equivalent") ); }
public void AreEqual_StringSet_WhenNotEqual( List <string> x, List <string> y ) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { SS = x }, new AttributeValue { SS = y } ); }); Assert.That( err.Message, Does.StartWith(" SS must be equivalent") ); }
public void AreEqual_Map_WhenMapNotSet() { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { M = new Dictionary <string, AttributeValue> { { "x", new AttributeValue { N = "23.88" } } } }, new AttributeValue { S = "abc" } ); }); Assert.That( err.Message, Does.StartWith(" IsMSet must be equal") ); }
public void AreEqual_List_WhenNotEqual( List <AttributeValue> x, List <AttributeValue> y, string expectedMessage ) { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { L = x }, new AttributeValue { L = y } ); }); Assert.That( err.Message, Does.StartWith(expectedMessage) ); }
public void AreEqual_List_WhenListNotSet() { var err = Assert.Throws <AssertionException>(() => { AttributeValueAssert.AreEqual( new AttributeValue { L = new List <AttributeValue> { new AttributeValue { N = "23.88" } } }, new AttributeValue { S = "abc" } ); }); Assert.That( err.Message, Does.StartWith(" IsLSet must be equal") ); }