public async Task Should_Call_Initialize() { // Given var storageService = Substitute.For <IStoreService>(); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storageService); // When await fixture.InitializeStore(); // Then await storageService.Received().InitializeAsync(); }
public async Task Should_Not_Throw_If_Store_Not_Initialized() { // Given var storageService = Substitute.For <IStoreService>(); storageService.IsInitialized.Returns(false); BaseStore <TestObjects> fixture = new BaseStoreFixture <TestObjects>().WithStorageService(storageService); // When var result = await Record.ExceptionAsync(async() => await fixture.InitializeStore()); // Then result.Should().BeNull(); }