public async Task Should_Push_Sync_Context() { // Given var storageService = Substitute.For <IStoreService>(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storageService); // When await fixture.RemoveAsync(new TestObjects()); // Then await storageService.SyncContext.Received().PushAsync(CancellationToken.None); }
public async Task Should_Call_Insert_Async() { // Given var table = Substitute.For <IMobileServiceSyncTable <TestObjects> >(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithSyncTable(table); // When await fixture.RemoveAsync(new TestObjects()); // Then await table.Received().DeleteAsync(Arg.Any <TestObjects>()); }
public async Task Should_Call_Initialize() { // Given var storageService = Substitute.For <IStoreService>(); storageService.IsInitialized.Returns(false); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storageService); // When await fixture.RemoveAsync(new TestObjects()); // Then await storageService.Received().InitializeAsync(); }
public async Task Should_Call_Pull_Async() { // Given var table = Substitute.For <IMobileServiceSyncTable <TestObjects> >(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithSyncTable(table); // When await fixture.RemoveAsync(new TestObjects()); // Then await table.Received().PullAsync(Arg.Any <string>(), Arg.Any <IMobileServiceTableQuery <TestObjects> >(), true, Arg.Any <CancellationToken>(), Arg.Any <PullOptions>()); }