public void GetFileAsync_AnyUri_GetException() { IRandomGenerator randomGeneratorStub = new AlwaysGenerateZero(); IFileService fileService = new FakeFileService(randomGeneratorStub); Assert.ThrowsAsync <Exception>(async() => await fileService.GetFileAsync("1")); }
public async Task GetFileAsync_AnyUri_GetFile() { IRandomGenerator randomGeneratorStub = new AlwaysGenerateOne(); IFileService fileService = new FakeFileService(randomGeneratorStub); var file = await fileService.GetFileAsync("1"); Assert.IsTrue(file.Content.Length > 0); Assert.IsTrue(file.FileName.EndsWith("bin")); }