diff --git a/Momento/Incubating/README.md b/Momento/Incubating/README.md index c9b5c4d3..7a1ade5d 100644 --- a/Momento/Incubating/README.md +++ b/Momento/Incubating/README.md @@ -24,7 +24,7 @@ class Driver key: "my-key", value: "my-value", ttlSeconds: 60, refreshTtl: false); // Set multiple values - scc.DictionaryMultiSet( + scc.DictionarySetMulti( cacheName: "my-cache", dictionaryName: "my-dictionary", new Dictionary() { @@ -42,7 +42,7 @@ class Driver string value = gr.String(); // "value1" // Get multiple values - CacheDictionaryMultiGetResponse mgr = scc.DictionaryMultiGet( + CacheDictionaryGetMultiResponse mgr = scc.DictionaryGetMulti( cacheName: "my-cache", dictionaryName: "my-dictionary", "key1", "key2", "key3", "key4"); diff --git a/Momento/Incubating/Responses/CacheDictonaryMultiGetResponse.cs b/Momento/Incubating/Responses/CacheDictionaryGetMultiResponse.cs similarity index 87% rename from Momento/Incubating/Responses/CacheDictonaryMultiGetResponse.cs rename to Momento/Incubating/Responses/CacheDictionaryGetMultiResponse.cs index 64cf76bf..506a518e 100644 --- a/Momento/Incubating/Responses/CacheDictonaryMultiGetResponse.cs +++ b/Momento/Incubating/Responses/CacheDictionaryGetMultiResponse.cs @@ -8,9 +8,9 @@ namespace MomentoSdk.Incubating.Responses { - public class CacheDictionaryMultiGetResponse + public class CacheDictionaryGetMultiResponse { - public CacheDictionaryMultiGetResponse() + public CacheDictionaryGetMultiResponse() { } diff --git a/Momento/Incubating/Responses/CacheDictionaryMultiSetResponse.cs b/Momento/Incubating/Responses/CacheDictionarySetMultiResponse.cs similarity index 84% rename from Momento/Incubating/Responses/CacheDictionaryMultiSetResponse.cs rename to Momento/Incubating/Responses/CacheDictionarySetMultiResponse.cs index 53e47c00..ec7e783d 100644 --- a/Momento/Incubating/Responses/CacheDictionaryMultiSetResponse.cs +++ b/Momento/Incubating/Responses/CacheDictionarySetMultiResponse.cs @@ -5,9 +5,9 @@ namespace MomentoSdk.Incubating.Responses { - public class CacheDictionaryMultiSetResponse + public class CacheDictionarySetMultiResponse { - public CacheDictionaryMultiSetResponse() + public CacheDictionarySetMultiResponse() { } diff --git a/Momento/Incubating/SimpleCacheClient.cs b/Momento/Incubating/SimpleCacheClient.cs index 241138db..1f9943fb 100644 --- a/Momento/Incubating/SimpleCacheClient.cs +++ b/Momento/Incubating/SimpleCacheClient.cs @@ -51,44 +51,44 @@ public async Task DictionaryGetAsync(string cacheNam return await Task.FromException(new NotImplementedException()); } - public CacheDictionaryMultiSetResponse DictionaryMultiSet(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) + public CacheDictionarySetMultiResponse DictionarySetMulti(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) { throw new NotImplementedException(); } - public CacheDictionaryMultiSetResponse DictionaryMultiSet(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) + public CacheDictionarySetMultiResponse DictionarySetMulti(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) { throw new NotImplementedException(); } - public async Task DictionaryMultiSetAsync(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) + public async Task DictionarySetMultiAsync(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) { - return await Task.FromException(new NotImplementedException()); + return await Task.FromException(new NotImplementedException()); } - public async Task DictionaryMultiSetAsync(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) + public async Task DictionarySetMultiAsync(string cacheName, string dictionaryName, IDictionary dictionary, bool refreshTtl, uint? ttlSeconds = null) { - return await Task.FromException(new NotImplementedException()); + return await Task.FromException(new NotImplementedException()); } - public CacheDictionaryMultiGetResponse DictionaryMultiGet(string cacheName, string dictionaryName, params byte[][] keys) + public CacheDictionaryGetMultiResponse DictionaryGetMulti(string cacheName, string dictionaryName, params byte[][] keys) { throw new NotImplementedException(); } - public CacheDictionaryMultiGetResponse DictionaryMultiGet(string cacheName, string dictionaryName, params string[] keys) + public CacheDictionaryGetMultiResponse DictionaryGetMulti(string cacheName, string dictionaryName, params string[] keys) { throw new NotImplementedException(); } - public async Task DictionaryMultiGetAsync(string cacheName, string dictionaryName, params byte[][] keys) + public async Task DictionaryGetMultiAsync(string cacheName, string dictionaryName, params byte[][] keys) { - return await Task.FromException(new NotImplementedException()); + return await Task.FromException(new NotImplementedException()); } - public async Task DictionaryMultiGetAsync(string cacheName, string dictionaryName, params string[] keys) + public async Task DictionaryGetMultiAsync(string cacheName, string dictionaryName, params string[] keys) { - return await Task.FromException(new NotImplementedException()); + return await Task.FromException(new NotImplementedException()); } public CacheDictionaryGetAllResponse DictionaryGetAll(string cacheName, string dictionaryName) diff --git a/Momento/Responses/CacheMultiGetResponse.cs b/Momento/Responses/CacheGetMultiResponse.cs similarity index 88% rename from Momento/Responses/CacheMultiGetResponse.cs rename to Momento/Responses/CacheGetMultiResponse.cs index 6873c09a..adf788f2 100644 --- a/Momento/Responses/CacheMultiGetResponse.cs +++ b/Momento/Responses/CacheGetMultiResponse.cs @@ -4,11 +4,11 @@ namespace MomentoSdk.Responses { - public class CacheMultiGetResponse + public class CacheGetMultiResponse { private readonly List responses; - public CacheMultiGetResponse(IEnumerable responses) + public CacheGetMultiResponse(IEnumerable responses) { this.responses = new(responses); } diff --git a/Momento/Responses/CacheMultiSetResponse.cs b/Momento/Responses/CacheSetMultiResponse.cs similarity index 75% rename from Momento/Responses/CacheMultiSetResponse.cs rename to Momento/Responses/CacheSetMultiResponse.cs index a4d4a8db..b9ec5db7 100644 --- a/Momento/Responses/CacheMultiSetResponse.cs +++ b/Momento/Responses/CacheSetMultiResponse.cs @@ -2,16 +2,16 @@ namespace MomentoSdk.Responses { - public class CacheMultiSetResponse + public class CacheSetMultiResponse { private readonly object items; - public CacheMultiSetResponse(IDictionary items) + public CacheSetMultiResponse(IDictionary items) { this.items = (object)items; } - public CacheMultiSetResponse(IDictionary items) + public CacheSetMultiResponse(IDictionary items) { this.items = (object)items; } diff --git a/Momento/ScsDataClient.cs b/Momento/ScsDataClient.cs index 29fcc2bf..264caa61 100644 --- a/Momento/ScsDataClient.cs +++ b/Momento/ScsDataClient.cs @@ -66,17 +66,17 @@ public async Task SetAsync(string cacheName, string key, byte[ return new CacheSetResponse(response); } - public async Task MultiGetAsync(string cacheName, IEnumerable keys) + public async Task GetMultiAsync(string cacheName, IEnumerable keys) { - return await MultiGetAsync(cacheName, keys.Select(key => Convert(key))); + return await GetMultiAsync(cacheName, keys.Select(key => Convert(key))); } - public async Task MultiGetAsync(string cacheName, IEnumerable keys) + public async Task GetMultiAsync(string cacheName, IEnumerable keys) { - return await MultiGetAsync(cacheName, keys.Select(key => Convert(key))); + return await GetMultiAsync(cacheName, keys.Select(key => Convert(key))); } - public async Task MultiGetAsync(string cacheName, IEnumerable keys) + public async Task GetMultiAsync(string cacheName, IEnumerable keys) { // Gather the tasks var tasks = keys.Select(key => SendGetAsync(cacheName, key)); @@ -104,24 +104,24 @@ public async Task MultiGetAsync(string cacheName, IEnumer // Package results var results = continuation.Result.Select(response => new CacheGetResponse(response)); - return new CacheMultiGetResponse(results); + return new CacheGetMultiResponse(results); } - public async Task MultiSetAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) + public async Task SetMultiAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) { - await MultiSetAsync(cacheName: cacheName, + await SetMultiAsync(cacheName: cacheName, items: items.ToDictionary(item => Convert(item.Key), item => Convert(item.Value)), ttlSeconds: ttlSeconds); } - public async Task MultiSetAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) + public async Task SetMultiAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) { - await MultiSetAsync(cacheName: cacheName, + await SetMultiAsync(cacheName: cacheName, items: items.ToDictionary(item => Convert(item.Key), item => Convert(item.Value)), ttlSeconds: ttlSeconds); } - public async Task MultiSetAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) + public async Task SetMultiAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) { // Gather the tasks var tasks = items.Select(item => SendSetAsync(cacheName, item.Key, item.Value, ttlSeconds)); diff --git a/Momento/SimpleCacheClient.cs b/Momento/SimpleCacheClient.cs index 74684b77..508bdb37 100644 --- a/Momento/SimpleCacheClient.cs +++ b/Momento/SimpleCacheClient.cs @@ -231,8 +231,8 @@ public async Task SetAsync(string cacheName, string key, byte[ /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public async Task MultiGetAsync(string cacheName, IEnumerable keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public async Task GetMultiAsync(string cacheName, IEnumerable keys) { if (cacheName == null) { @@ -247,7 +247,7 @@ public async Task MultiGetAsync(string cacheName, IEnumer throw new ArgumentNullException(nameof(keys), "Each key must be non-null"); } - return await this.dataClient.MultiGetAsync(cacheName, keys); + return await this.dataClient.GetMultiAsync(cacheName, keys); } /// @@ -255,8 +255,8 @@ public async Task MultiGetAsync(string cacheName, IEnumer /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public async Task MultiGetAsync(string cacheName, IEnumerable keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public async Task GetMultiAsync(string cacheName, IEnumerable keys) { if (cacheName == null) { @@ -272,7 +272,7 @@ public async Task MultiGetAsync(string cacheName, IEnumer } - return await this.dataClient.MultiGetAsync(cacheName, keys); + return await this.dataClient.GetMultiAsync(cacheName, keys); } /// @@ -280,8 +280,8 @@ public async Task MultiGetAsync(string cacheName, IEnumer /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public async Task MultiGetAsync(string cacheName, params byte[][] keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public async Task GetMultiAsync(string cacheName, params byte[][] keys) { if (cacheName == null) { @@ -296,7 +296,7 @@ public async Task MultiGetAsync(string cacheName, params throw new ArgumentNullException(nameof(keys), "Each key must be non-null"); } - return await this.dataClient.MultiGetAsync(cacheName, keys); + return await this.dataClient.GetMultiAsync(cacheName, keys); } /// @@ -304,8 +304,8 @@ public async Task MultiGetAsync(string cacheName, params /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public async Task MultiGetAsync(string cacheName, params string[] keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public async Task GetMultiAsync(string cacheName, params string[] keys) { if (cacheName == null) { @@ -320,7 +320,7 @@ public async Task MultiGetAsync(string cacheName, params throw new ArgumentNullException(nameof(keys), "Each key must be non-null"); } - return await this.dataClient.MultiGetAsync(cacheName, keys); + return await this.dataClient.GetMultiAsync(cacheName, keys); } /// @@ -328,8 +328,8 @@ public async Task MultiGetAsync(string cacheName, params /// /// Name of the cache to store the items in. /// The items to set. - /// Future with CacheMultiSetResponse containing the data set. - public async Task MultiSetAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) + /// Future with CacheSetMultiResponse containing the data set. + public async Task SetMultiAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) { if (cacheName == null) { @@ -344,8 +344,8 @@ public async Task MultiSetAsync(string cacheName, IDictio throw new ArgumentNullException(nameof(items), "Each value must be non-null"); } - await this.dataClient.MultiSetAsync(cacheName, items, ttlSeconds); - return new CacheMultiSetResponse(items); + await this.dataClient.SetMultiAsync(cacheName, items, ttlSeconds); + return new CacheSetMultiResponse(items); } /// @@ -353,8 +353,8 @@ public async Task MultiSetAsync(string cacheName, IDictio /// /// Name of the cache to store the items in. /// The items to set. - /// Future with CacheMultiSetResponse containing the data set. - public async Task MultiSetAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) + /// Future with CacheSetMultiResponse containing the data set. + public async Task SetMultiAsync(string cacheName, IDictionary items, uint? ttlSeconds = null) { if (cacheName == null) { @@ -369,8 +369,8 @@ public async Task MultiSetAsync(string cacheName, IDictio throw new ArgumentNullException(nameof(items), "Each value must be non-null"); } - await this.dataClient.MultiSetAsync(cacheName, items, ttlSeconds); - return new CacheMultiSetResponse(items); + await this.dataClient.SetMultiAsync(cacheName, items, ttlSeconds); + return new CacheSetMultiResponse(items); } /// @@ -490,11 +490,11 @@ public CacheGetResponse Get(string cacheName, string key) /// Name of the cache to perform the lookup in. /// The keys to get. /// Response object with the status of the get operation and the associated value data. - public CacheMultiGetResponse MultiGet(string cacheName, IEnumerable keys) + public CacheGetMultiResponse GetMulti(string cacheName, IEnumerable keys) { try { - return MultiGetAsync(cacheName, keys).Result; + return GetMultiAsync(cacheName, keys).Result; } catch (AggregateException e) { @@ -508,11 +508,11 @@ public CacheMultiGetResponse MultiGet(string cacheName, IEnumerable keys /// Name of the cache to perform the lookup in. /// The keys to get. /// Response object with the status of the get operation and the associated value data. - public CacheMultiGetResponse MultiGet(string cacheName, IEnumerable keys) + public CacheGetMultiResponse GetMulti(string cacheName, IEnumerable keys) { try { - return MultiGetAsync(cacheName, keys).Result; + return GetMultiAsync(cacheName, keys).Result; } catch (AggregateException e) { @@ -525,12 +525,12 @@ public CacheMultiGetResponse MultiGet(string cacheName, IEnumerable keys /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public CacheMultiGetResponse MultiGet(string cacheName, params byte[][] keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public CacheGetMultiResponse GetMulti(string cacheName, params byte[][] keys) { try { - return MultiGetAsync(cacheName, keys).Result; + return GetMultiAsync(cacheName, keys).Result; } catch (AggregateException e) { @@ -543,12 +543,12 @@ public CacheMultiGetResponse MultiGet(string cacheName, params byte[][] keys) /// /// Name of the cache to perform the lookup in. /// The keys to get. - /// Future with CacheMultiGetResponse containing the status of the get operation and the associated value data. - public CacheMultiGetResponse MultiGet(string cacheName, params string[] keys) + /// Future with CacheGetMultiResponse containing the status of the get operation and the associated value data. + public CacheGetMultiResponse GetMulti(string cacheName, params string[] keys) { try { - return MultiGetAsync(cacheName, keys).Result; + return GetMultiAsync(cacheName, keys).Result; } catch (AggregateException e) { @@ -561,12 +561,12 @@ public CacheMultiGetResponse MultiGet(string cacheName, params string[] keys) /// /// Name of the cache to store the items in. /// The items to set. - /// Future with CacheMultiSetResponse containing the data set. - public CacheMultiSetResponse MultiSet(string cacheName, IDictionary items, uint? ttlSeconds = null) + /// Future with CacheSetMultiResponse containing the data set. + public CacheSetMultiResponse SetMulti(string cacheName, IDictionary items, uint? ttlSeconds = null) { try { - return MultiSetAsync(cacheName, items, ttlSeconds).Result; + return SetMultiAsync(cacheName, items, ttlSeconds).Result; } catch (AggregateException e) { @@ -579,12 +579,12 @@ public CacheMultiSetResponse MultiSet(string cacheName, IDictionary /// Name of the cache to store the items in. /// The items to set. - /// Future with CacheMultiSetResponse containing the data set. - public CacheMultiSetResponse MultiSet(string cacheName, IDictionary items, uint? ttlSeconds = null) + /// Future with CacheSetMultiResponse containing the data set. + public CacheSetMultiResponse SetMulti(string cacheName, IDictionary items, uint? ttlSeconds = null) { try { - return MultiSetAsync(cacheName, items, ttlSeconds).Result; + return SetMultiAsync(cacheName, items, ttlSeconds).Result; } catch (AggregateException e) { diff --git a/MomentoIntegrationTest/SimpleCacheDataTest.cs b/MomentoIntegrationTest/SimpleCacheDataTest.cs index b39fde3f..0a27d1cc 100644 --- a/MomentoIntegrationTest/SimpleCacheDataTest.cs +++ b/MomentoIntegrationTest/SimpleCacheDataTest.cs @@ -139,19 +139,19 @@ public async void SetAsync_KeyIsStringValueIsBytes_HappyPath() } [Fact] - public async void MultiGetAsync_NullCheckBytes_ThrowsException() + public async void GetMultiAsync_NullCheckBytes_ThrowsException() { - await Assert.ThrowsAsync(async () => await client.MultiGetAsync(null, new List())); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", (List)null)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync(null, new List())); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", (List)null)); var badList = new List(new byte[][] { Utf8ToBytes("asdf"), null }); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", badList)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", badList)); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", Utf8ToBytes("key1"), null)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", Utf8ToBytes("key1"), null)); } [Fact] - public async void MultiGetAsync_KeysAreBytes_HappyPath() + public async void GetMultiAsync_KeysAreBytes_HappyPath() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -162,7 +162,7 @@ public async void MultiGetAsync_KeysAreBytes_HappyPath() List keys = new() { Utf8ToBytes(cacheKey1), Utf8ToBytes(cacheKey2) }; - CacheMultiGetResponse result = await client.MultiGetAsync(cacheName, keys); + CacheGetMultiResponse result = await client.GetMultiAsync(cacheName, keys); string stringResult1 = result.Strings()[0]; string stringResult2 = result.Strings()[1]; Assert.Equal(cacheValue1, stringResult1); @@ -170,7 +170,7 @@ public async void MultiGetAsync_KeysAreBytes_HappyPath() } [Fact] - public async void MultiGetAsync_KeysAreBytes_HappyPath2() + public async void GetMultiAsync_KeysAreBytes_HappyPath2() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -179,7 +179,7 @@ public async void MultiGetAsync_KeysAreBytes_HappyPath2() client.Set(cacheName, cacheKey1, cacheValue1); client.Set(cacheName, cacheKey2, cacheValue2); - CacheMultiGetResponse result = await client.MultiGetAsync(cacheName, cacheKey1, cacheKey2); + CacheGetMultiResponse result = await client.GetMultiAsync(cacheName, cacheKey1, cacheKey2); string stringResult1 = result.Strings()[0]; string stringResult2 = result.Strings()[1]; Assert.Equal(cacheValue1, stringResult1); @@ -187,19 +187,19 @@ public async void MultiGetAsync_KeysAreBytes_HappyPath2() } [Fact] - public async void MultiGetAsync_NullCheckString_ThrowsException() + public async void GetMultiAsync_NullCheckString_ThrowsException() { - await Assert.ThrowsAsync(async () => await client.MultiGetAsync(null, new List())); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", (List)null)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync(null, new List())); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", (List)null)); List strings = new(new string[] { "key1", "key2", null }); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", strings)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", strings)); - await Assert.ThrowsAsync(async () => await client.MultiGetAsync("cache", "key1", "key2", null)); + await Assert.ThrowsAsync(async () => await client.GetMultiAsync("cache", "key1", "key2", null)); } [Fact] - public async void MultiGetAsync_KeysAreString_HappyPath() + public async void GetMultiAsync_KeysAreString_HappyPath() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -209,39 +209,39 @@ public async void MultiGetAsync_KeysAreString_HappyPath() client.Set(cacheName, cacheKey2, cacheValue2); List keys = new() { cacheKey1, cacheKey2, "key123123" }; - CacheMultiGetResponse result = await client.MultiGetAsync(cacheName, keys); + CacheGetMultiResponse result = await client.GetMultiAsync(cacheName, keys); Assert.Equal(result.Strings(), new string[] { cacheValue1, cacheValue2, null }); Assert.Equal(result.Status(), new CacheGetStatus[] { CacheGetStatus.HIT, CacheGetStatus.HIT, CacheGetStatus.MISS }); } [Fact] - public void MultiGetAsync_Failure() + public void GetMultiAsync_Failure() { // Set very small timeout for dataClientOperationTimeoutMilliseconds SimpleCacheClient simpleCacheClient = new SimpleCacheClient(authKey, defaultTtlSeconds, 1); List keys = new() { "key1", "key2", "key3", "key4" }; - Assert.ThrowsAsync(() => simpleCacheClient.MultiGetAsync(cacheName, keys)); + Assert.ThrowsAsync(() => simpleCacheClient.GetMultiAsync(cacheName, keys)); } [Fact] - public async void MultiSetAsync_NullCheckBytes_ThrowsException() + public async void SetMultiAsync_NullCheckBytes_ThrowsException() { - await Assert.ThrowsAsync(async () => await client.MultiSetAsync(null, new Dictionary())); - await Assert.ThrowsAsync(async () => await client.MultiSetAsync("cache", (Dictionary)null)); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync(null, new Dictionary())); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync("cache", (Dictionary)null)); var badDictionary = new Dictionary() { { Utf8ToBytes("asdf"), null } }; - await Assert.ThrowsAsync(async () => await client.MultiSetAsync("cache", badDictionary)); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync("cache", badDictionary)); } [Fact] - public async void MultiSetAsync_ItemsAreBytes_HappyPath() + public async void SetMultiAsync_ItemsAreBytes_HappyPath() { var dictionary = new Dictionary() { { Utf8ToBytes("key1"), Utf8ToBytes("value1") }, { Utf8ToBytes("key2"), Utf8ToBytes("value2") } }; - CacheMultiSetResponse response = await client.MultiSetAsync(cacheName, dictionary); + CacheSetMultiResponse response = await client.SetMultiAsync(cacheName, dictionary); Assert.Equal(dictionary, response.Bytes()); var getResponse = await client.GetAsync(cacheName, Utf8ToBytes("key1")); @@ -252,23 +252,23 @@ public async void MultiSetAsync_ItemsAreBytes_HappyPath() } [Fact] - public async void MultiSetAsync_NullCheckStrings_ThrowsException() + public async void SetMultiAsync_NullCheckStrings_ThrowsException() { - await Assert.ThrowsAsync(async () => await client.MultiSetAsync(null, new Dictionary())); - await Assert.ThrowsAsync(async () => await client.MultiSetAsync("cache", (Dictionary)null)); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync(null, new Dictionary())); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync("cache", (Dictionary)null)); var badDictionary = new Dictionary() { { "asdf", null } }; - await Assert.ThrowsAsync(async () => await client.MultiSetAsync("cache", badDictionary)); + await Assert.ThrowsAsync(async () => await client.SetMultiAsync("cache", badDictionary)); } [Fact] - public async void MultiSetAsync_KeysAreString_HappyPath() + public async void SetMultiAsync_KeysAreString_HappyPath() { var dictionary = new Dictionary() { { "key1", "value1" }, { "key2", "value2" } }; - CacheMultiSetResponse response = await client.MultiSetAsync(cacheName, dictionary); + CacheSetMultiResponse response = await client.SetMultiAsync(cacheName, dictionary); Assert.Equal(dictionary, response.Strings()); var getResponse = await client.GetAsync(cacheName, "key1"); @@ -411,19 +411,19 @@ public void Set_KeyIsStringValueIsBytes_HappyPath() } [Fact] - public void MultiGet_NullCheckBytes_ThrowsException() + public void GetMulti_NullCheckBytes_ThrowsException() { - Assert.Throws(() => client.MultiGet(null, new List())); - Assert.Throws(() => client.MultiGet("cache", (List)null)); + Assert.Throws(() => client.GetMulti(null, new List())); + Assert.Throws(() => client.GetMulti("cache", (List)null)); var badList = new List(new byte[][] { Utf8ToBytes("asdf"), null }); - Assert.Throws(() => client.MultiGet("cache", badList)); + Assert.Throws(() => client.GetMulti("cache", badList)); - Assert.Throws(() => client.MultiGet("cache", Utf8ToBytes("key1"), null)); + Assert.Throws(() => client.GetMulti("cache", Utf8ToBytes("key1"), null)); } [Fact] - public void MultiGet_KeysAreBytes_HappyPath() + public void GetMulti_KeysAreBytes_HappyPath() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -434,7 +434,7 @@ public void MultiGet_KeysAreBytes_HappyPath() List keys = new() { Utf8ToBytes(cacheKey1), Utf8ToBytes(cacheKey2) }; - CacheMultiGetResponse result = client.MultiGet(cacheName, keys); + CacheGetMultiResponse result = client.GetMulti(cacheName, keys); string stringResult1 = result.Strings()[0]; string stringResult2 = result.Strings()[1]; Assert.Equal(cacheValue1, stringResult1); @@ -442,7 +442,7 @@ public void MultiGet_KeysAreBytes_HappyPath() } [Fact] - public void MultiGet_KeysAreBytes_HappyPath2() + public void GetMulti_KeysAreBytes_HappyPath2() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -451,7 +451,7 @@ public void MultiGet_KeysAreBytes_HappyPath2() client.Set(cacheName, cacheKey1, cacheValue1); client.Set(cacheName, cacheKey2, cacheValue2); - CacheMultiGetResponse result = client.MultiGet(cacheName, cacheKey1, cacheKey2); + CacheGetMultiResponse result = client.GetMulti(cacheName, cacheKey1, cacheKey2); string stringResult1 = result.Strings()[0]; string stringResult2 = result.Strings()[1]; Assert.Equal(cacheValue1, stringResult1); @@ -459,19 +459,19 @@ public void MultiGet_KeysAreBytes_HappyPath2() } [Fact] - public void MultiGet_NullCheckString_ThrowsException() + public void GetMulti_NullCheckString_ThrowsException() { - Assert.Throws(() => client.MultiGet(null, new List())); - Assert.Throws(() => client.MultiGet("cache", (List)null)); + Assert.Throws(() => client.GetMulti(null, new List())); + Assert.Throws(() => client.GetMulti("cache", (List)null)); List strings = new(new string[] { "key1", "key2", null }); - Assert.Throws(() => client.MultiGet("cache", strings)); + Assert.Throws(() => client.GetMulti("cache", strings)); - Assert.Throws(() => client.MultiGet("cache", "key1", "key2", null)); + Assert.Throws(() => client.GetMulti("cache", "key1", "key2", null)); } [Fact] - public void MultiGet_KeysAreString_HappyPath() + public void GetMulti_KeysAreString_HappyPath() { string cacheKey1 = "key1"; string cacheValue1 = "value1"; @@ -481,39 +481,39 @@ public void MultiGet_KeysAreString_HappyPath() client.Set(cacheName, cacheKey2, cacheValue2); List keys = new() { cacheKey1, cacheKey2, "key123123" }; - CacheMultiGetResponse result = client.MultiGet(cacheName, keys); + CacheGetMultiResponse result = client.GetMulti(cacheName, keys); Assert.Equal(result.Strings(), new string[] { cacheValue1, cacheValue2, null }); Assert.Equal(result.Status(), new CacheGetStatus[] { CacheGetStatus.HIT, CacheGetStatus.HIT, CacheGetStatus.MISS }); } [Fact] - public void MultiGet_Failure() + public void GetMulti_Failure() { // Set very small timeout for dataClientOperationTimeoutMilliseconds SimpleCacheClient simpleCacheClient = new SimpleCacheClient(authKey, defaultTtlSeconds, 1); List keys = new() { "key1", "key2", "key3", "key4" }; - Assert.Throws(() => simpleCacheClient.MultiGet(cacheName, keys)); + Assert.Throws(() => simpleCacheClient.GetMulti(cacheName, keys)); } [Fact] - public void MultiSet_NullCheckBytes_ThrowsException() + public void SetMulti_NullCheckBytes_ThrowsException() { - Assert.Throws(() => client.MultiSet(null, new Dictionary())); - Assert.Throws(() => client.MultiSet("cache", (Dictionary)null)); + Assert.Throws(() => client.SetMulti(null, new Dictionary())); + Assert.Throws(() => client.SetMulti("cache", (Dictionary)null)); var badDictionary = new Dictionary() { { Utf8ToBytes("asdf"), null } }; - Assert.Throws(() => client.MultiSet("cache", badDictionary)); + Assert.Throws(() => client.SetMulti("cache", badDictionary)); } [Fact] - public void MultiSet_ItemsAreBytes_HappyPath() + public void SetMulti_ItemsAreBytes_HappyPath() { var dictionary = new Dictionary() { { Utf8ToBytes("key1"), Utf8ToBytes("value1") }, { Utf8ToBytes("key2"), Utf8ToBytes("value2") } }; - CacheMultiSetResponse response = client.MultiSet(cacheName, dictionary); + CacheSetMultiResponse response = client.SetMulti(cacheName, dictionary); Assert.Equal(dictionary, response.Bytes()); var getResponse = client.Get(cacheName, Utf8ToBytes("key1")); @@ -525,23 +525,23 @@ public void MultiSet_ItemsAreBytes_HappyPath() [Fact] - public void MultiSet_NullCheckString_ThrowsException() + public void SetMulti_NullCheckString_ThrowsException() { - Assert.Throws(() => client.MultiSet(null, new Dictionary())); - Assert.Throws(() => client.MultiSet("cache", (Dictionary)null)); + Assert.Throws(() => client.SetMulti(null, new Dictionary())); + Assert.Throws(() => client.SetMulti("cache", (Dictionary)null)); var badDictionary = new Dictionary() { { "asdf", null } }; - Assert.Throws(() => client.MultiSet("cache", badDictionary)); + Assert.Throws(() => client.SetMulti("cache", badDictionary)); } [Fact] - public void MultiSet_KeysAreString_HappyPath() + public void SetMulti_KeysAreString_HappyPath() { var dictionary = new Dictionary() { { "key1", "value1" }, { "key2", "value2" } }; - CacheMultiSetResponse response = client.MultiSet(cacheName, dictionary); + CacheSetMultiResponse response = client.SetMulti(cacheName, dictionary); Assert.Equal(dictionary, response.Strings()); var getResponse = client.Get(cacheName, "key1");