public async Task Should_Call_Update_Async() { // Given var table = Substitute.For <IMobileServiceTable <TestObjects> >(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithTable(table); // When await fixture.UpdateOnlineAsync(new TestObjects()); // Then await table.Received().UpdateAsync(Arg.Any <TestObjects>()); }
public async Task Should_Push_Sync_Context() { // Given var storageService = Substitute.For <IStoreService>(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storageService); // When await fixture.UpdateOnlineAsync(new TestObjects()); // Then await storageService.SyncContext.Received().PushAsync(CancellationToken.None); }
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.UpdateOnlineAsync(new TestObjects()); // Then await storageService.Received().InitializeAsync(); }