public async Task Should_Call_Table() { // Given BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>(); // When await fixture.GetItemAsync("1", 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.GetItemAsync("1"); // Then await storeService.Received().InitializeAsync(); }
public async Task Should_Call_Pull_Async() { // Given var syncTable = Substitute.For <IMobileServiceSyncTable <TestObjects> >(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithSyncTable(syncTable); // When await fixture.GetItemAsync("1", true); // Then await syncTable.Received().PullAsync(Arg.Any <string>(), Arg.Any <IMobileServiceTableQuery <TestObjects> >(), Arg.Any <bool>(), CancellationToken.None, Arg.Any <PullOptions>()); }