Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
[client][managed][offline] Removed PullAsync overloads that do not ta…
Browse files Browse the repository at this point in the history
…ke queryKey
  • Loading branch information
hasankhan committed Nov 21, 2014
1 parent a11ccad commit 88cac8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ public static Task PullAsync<T, U>(this IMobileServiceSyncTable<T> table, string
return table.PullAsync(queryId, query, pushOtherTables: true, cancellationToken: cancellationToken);
}

/// <summary>
/// Pulls all items that match the given query
/// from the associated remote table.
/// </summary>
/// <param name="table">The instance of table to execute pull on.</param>
/// <param name="query">
/// An OData query that determines which items to
/// pull from the remote table.
/// </param>
/// <returns>
/// A task that completes when pull operation has finished.
/// </returns>
public static Task PullAsync<T, U>(this IMobileServiceSyncTable<T> table, IMobileServiceTableQuery<U> query)
{
return table.PullAsync(null, query, cancellationToken: CancellationToken.None);
}

/// <summary>
/// Pulls all items that match the given query
/// from the associated remote table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<IMobileServiceSyncTable<ToDoWithSystemPropertiesType>, Task> action)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>("String"), "Hey");
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);
}
Expand All @@ -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"));
}
Expand Down Expand Up @@ -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<ArgumentException>(() => table.PullAsync(query));
var exception = await ThrowsAsync<ArgumentException>(() => table.PullAsync(null, query));
Assert.AreEqual(exception.ParamName, "query");
Assert.StartsWith(exception.Message, "The supported table options does not include orderby.");
}
Expand All @@ -589,7 +589,7 @@ public async Task PullAsync_Throws_WhenTopClauseIsSpecifiedAndOptionIsNotSet()
table.SupportedOptions &= ~MobileServiceRemoteTableOptions.Top;
var query = table.Take(30);

var exception = await ThrowsAsync<ArgumentException>(() => table.PullAsync(query));
var exception = await ThrowsAsync<ArgumentException>(() => table.PullAsync(null, query));
Assert.AreEqual(exception.ParamName, "query");
Assert.StartsWith(exception.Message, "The supported table options does not include top.");
}
Expand All @@ -604,7 +604,7 @@ public async Task PullAsync_Throws_WhenSkipClauseIsSpecifiedAndOptionIsNotSet()
table.SupportedOptions &= ~MobileServiceRemoteTableOptions.Skip;
var query = table.Skip(30);

var exception = await ThrowsAsync<ArgumentException>(() => table.PullAsync(query));
var exception = await ThrowsAsync<ArgumentException>(() => table.PullAsync(null, query));
Assert.AreEqual(exception.ParamName, "query");
Assert.StartsWith(exception.Message, "The supported table options does not include skip.");
}
Expand Down

0 comments on commit 88cac8c

Please sign in to comment.