public async Task GetFileAsync_Throws_InvalidCastException_If_Store_Does_Not_Support_ITusReadableStore() { var context = new EventContextForTest { FileId = Guid.NewGuid().ToString(), Store = Substitute.For <ITusStore>() }; await Should.ThrowAsync(async() => await context.GetFileAsync(), typeof(InvalidCastException)); }
public async Task GetFileAsync_Returns_Null_If_FileId_Is_Missing() { var context = new EventContextForTest { Store = CreateReadableStoreWithExistingFile() }; var file = await context.GetFileAsync(); file.ShouldBeNull(); }
public async Task GetFileAsync_Returns_The_File_If_FileId_Is_Set_And_Store_Supports_ITusReadableStore() { var context = new EventContextForTest { FileId = Guid.NewGuid().ToString(), Store = CreateReadableStoreWithExistingFile() }; var file = await context.GetFileAsync(); file.ShouldNotBeNull(); }