Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: list push, pop, and fetch #115

Merged
merged 13 commits into from
Aug 24, 2022
18 changes: 9 additions & 9 deletions IncubatingIntegrationTest/DictionaryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ public async Task DictionaryFetchAsync_HasContentString_HappyPath()
await client.DictionarySetAsync(cacheName, dictionaryName, field1, value1, true, ttlSeconds: 10);
await client.DictionarySetAsync(cacheName, dictionaryName, field2, value2, true, ttlSeconds: 10);

var getAllResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);
var fetchResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);

Assert.Equal(CacheGetStatus.HIT, getAllResponse.Status);
Assert.Equal(getAllResponse.StringDictionary(), contentDictionary);
Assert.Equal(CacheGetStatus.HIT, fetchResponse.Status);
Assert.Equal(fetchResponse.StringDictionary(), contentDictionary);
}

[Fact]
Expand All @@ -494,17 +494,17 @@ public async Task DictionaryFetchAsync_HasContentByteArray_HappyPath()
await client.DictionarySetAsync(cacheName, dictionaryName, field1, value1, true, ttlSeconds: 10);
await client.DictionarySetAsync(cacheName, dictionaryName, field2, value2, true, ttlSeconds: 10);

var getAllResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);
var fetchResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);

Assert.Equal(CacheGetStatus.HIT, getAllResponse.Status);
Assert.Equal(CacheGetStatus.HIT, fetchResponse.Status);

// Exercise byte array dictionary structural equality comparer
Assert.True(getAllResponse.ByteArrayDictionary!.ContainsKey(field1));
Assert.True(getAllResponse.ByteArrayDictionary!.ContainsKey(field2));
Assert.Equal(2, getAllResponse.ByteArrayDictionary!.Count);
Assert.True(fetchResponse.ByteArrayDictionary!.ContainsKey(field1));
Assert.True(fetchResponse.ByteArrayDictionary!.ContainsKey(field2));
Assert.Equal(2, fetchResponse.ByteArrayDictionary!.Count);

// Exercise DictionaryEquals extension
Assert.True(getAllResponse.ByteArrayDictionary!.DictionaryEquals(contentDictionary));
Assert.True(fetchResponse.ByteArrayDictionary!.DictionaryEquals(contentDictionary));
}

[Theory]
Expand Down
Loading