From 88cac8cb1c159b0d9ae618ec32a65dce57d8ee7a Mon Sep 17 00:00:00 2001 From: Hasan Khan Date: Thu, 20 Nov 2014 17:07:21 -0800 Subject: [PATCH] [client][managed][offline] Removed PullAsync overloads that do not take queryKey --- .../MobileServiceSyncTableExtensions.cs | 17 ----------------- .../UnitTests/MobileServiceClient.Test.cs | 2 +- .../Sync/MobileServiceSyncTable.Generic.Test.cs | 16 ++++++++-------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices/Extensions/MobileServiceSyncTableExtensions.cs b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices/Extensions/MobileServiceSyncTableExtensions.cs index efbe3efe6..1d314b3a3 100644 --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices/Extensions/MobileServiceSyncTableExtensions.cs +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices/Extensions/MobileServiceSyncTableExtensions.cs @@ -80,23 +80,6 @@ public static Task PullAsync(this IMobileServiceSyncTable table, string return table.PullAsync(queryId, query, pushOtherTables: true, cancellationToken: cancellationToken); } - /// - /// Pulls all items that match the given query - /// from the associated remote table. - /// - /// The instance of table to execute pull on. - /// - /// An OData query that determines which items to - /// pull from the remote table. - /// - /// - /// A task that completes when pull operation has finished. - /// - public static Task PullAsync(this IMobileServiceSyncTable table, IMobileServiceTableQuery query) - { - return table.PullAsync(null, query, cancellationToken: CancellationToken.None); - } - /// /// Pulls all items that match the given query /// from the associated remote table. diff --git a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs index 32b26df93..619fbb6de 100644 --- a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs +++ b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs @@ -257,7 +257,7 @@ public async Task PurgeAsync_Throws_WhenSyncContextIsNotInitialized() [TestMethod] public async Task PullAsync_Throws_WhenSyncContextIsNotInitialized() { - await this.TestSyncContextNotInitialized(table => table.PullAsync(table.Where(t => t.String == "abc"))); + await this.TestSyncContextNotInitialized(table => table.PullAsync(null, table.Where(t => t.String == "abc"))); } private async Task TestSyncContextNotInitialized(Func, Task> action) diff --git a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/Table/Sync/MobileServiceSyncTable.Generic.Test.cs b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/Table/Sync/MobileServiceSyncTable.Generic.Test.cs index c8a8e87e5..eba7850e0 100644 --- a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/Table/Sync/MobileServiceSyncTable.Generic.Test.cs +++ b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/Table/Sync/MobileServiceSyncTable.Generic.Test.cs @@ -313,7 +313,7 @@ public async Task PullAsync_UsesSkipAndTakeThenFollowsLinkThenUsesSkipAndTake() Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); - await table.PullAsync(table.Take(51).Skip(3)); + await table.PullAsync(null, table.Take(51).Skip(3)); Assert.AreEqual(store.TableMap["stringId_test_table"].Count, 6); Assert.AreEqual(store.TableMap["stringId_test_table"]["abc"].Value("String"), "Hey"); @@ -440,7 +440,7 @@ public async Task PullAsync_UsesTopInQuery_IfLessThan50() Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); - await table.PullAsync(table.Take(49)); + await table.PullAsync(null, table.Take(49)); Assert.AreEqual(store.TableMap["stringId_test_table"].Count, 2); @@ -463,7 +463,7 @@ public async Task PullAsync_DefaultsTo50_IfGreaterThan50() Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); - await table.PullAsync(table.Take(51)); + await table.PullAsync(null, table.Take(51)); Assert.AreEqual(store.TableMap["stringId_test_table"].Count, 2); @@ -487,7 +487,7 @@ public async Task PullAsync_DoesNotFollowLink_IfMaxRecordsAreRetrieved() Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); - await table.PullAsync(table.Take(1)); + await table.PullAsync(null, table.Take(1)); Assert.AreEqual(store.TableMap["stringId_test_table"].Count, 1); } @@ -508,7 +508,7 @@ public async Task PullAsync_DoesNotFollowLink_IfResultIsEmpty() Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); - await table.PullAsync(table.Take(1)); + await table.PullAsync(null, table.Take(1)); Assert.IsFalse(store.TableMap.ContainsKey("stringId_test_table")); } @@ -574,7 +574,7 @@ public async Task PullAsync_Throws_WhenOrderByClauseIsSpecifiedAndOptionIsNotSet table.SupportedOptions &= ~MobileServiceRemoteTableOptions.OrderBy; var query = table.OrderBy(x => x.String); - var exception = await ThrowsAsync(() => table.PullAsync(query)); + var exception = await ThrowsAsync(() => table.PullAsync(null, query)); Assert.AreEqual(exception.ParamName, "query"); Assert.StartsWith(exception.Message, "The supported table options does not include orderby."); } @@ -589,7 +589,7 @@ public async Task PullAsync_Throws_WhenTopClauseIsSpecifiedAndOptionIsNotSet() table.SupportedOptions &= ~MobileServiceRemoteTableOptions.Top; var query = table.Take(30); - var exception = await ThrowsAsync(() => table.PullAsync(query)); + var exception = await ThrowsAsync(() => table.PullAsync(null, query)); Assert.AreEqual(exception.ParamName, "query"); Assert.StartsWith(exception.Message, "The supported table options does not include top."); } @@ -604,7 +604,7 @@ public async Task PullAsync_Throws_WhenSkipClauseIsSpecifiedAndOptionIsNotSet() table.SupportedOptions &= ~MobileServiceRemoteTableOptions.Skip; var query = table.Skip(30); - var exception = await ThrowsAsync(() => table.PullAsync(query)); + var exception = await ThrowsAsync(() => table.PullAsync(null, query)); Assert.AreEqual(exception.ParamName, "query"); Assert.StartsWith(exception.Message, "The supported table options does not include skip."); }