public void ThrowsExceptionIfFileDoesntExist() { var directory = new FakeFileSystem(); var loader = new ImageFileLoader(directory, urlGenerator.Object); var exception = Record.Exception(() => loader.GetImageBytes("/cassette.axd/file/test-hash123.png")); exception.ShouldBeType<FileNotFoundException>(); }
public void ThrowsExceptionIfFileDoesntExist() { var directory = new FakeFileSystem(); var loader = new ImageFileLoader(directory, urlGenerator.Object); var exception = Record.Exception(() => loader.GetImageBytes("/cassette.axd/file/test-hash123.png")); exception.ShouldBeType <FileNotFoundException>(); }
public void ReadsBytesFromFile() { var directory = new FakeFileSystem { { "~/test.png", new byte[] { 1, 2, 3 } } }; var loader = new ImageFileLoader(directory, urlGenerator.Object); var output = loader.GetImageBytes("/cassette.axd/file/test-hash123.png"); output.ShouldEqual(new byte[] { 1, 2, 3 }); }
public void ReadsBytesFromFile() { var directory = new FakeFileSystem { { "~/test.png", new byte[] { 1, 2, 3 } } }; var loader = new ImageFileLoader(directory, urlGenerator.Object); var output = loader.GetImageBytes("/cassette.axd/file/test-hash123.png"); output.ShouldEqual(new byte[] { 1, 2, 3 }); }