public async Task Should_Call_Table() { // Given BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>(); // When await fixture.GetItemsAsync(true); // Then fixture.Table.Received(); }
public async Task Should_Call_Initialize_Store() { // Given var storeService = Substitute.For <IStoreService>(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storeService); // When await fixture.GetItemsAsync(); // Then await storeService.Received().InitializeAsync(); }
public async Task Should_Not_Call_Pull_Async() { // Given var table = Substitute.For <IMobileServiceSyncTable <TestObjects> >(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithSyncTable(table); // When await fixture.GetItemsAsync(); // Then await table.DidNotReceive().PullAsync(Arg.Any <string>(), Arg.Any <IMobileServiceTableQuery <TestObjects> >(), Arg.Any <bool>(), CancellationToken.None, Arg.Any <PullOptions>()); }