public void EndToEndTest() { // Arrange. var device = new Device(); var logger = new TracefileBuilder(device); var expectedData = RenderScene(device); var stringWriter = new StringWriter(); logger.WriteTo(stringWriter); var loggedJson = stringWriter.ToString(); var logReader = new StringReader(loggedJson); var tracefile = Tracefile.FromTextReader(logReader); // Act. var swapChainPresenter = new RawSwapChainPresenter(); var replayer = new Replayer( tracefile.Frames[0], tracefile.Frames[0].Events.Last(), swapChainPresenter); replayer.Replay(); var actualData = swapChainPresenter.Data; // Assert. Assert.That(actualData, Is.EqualTo(expectedData)); }
public IDocument Create(string path) { using (var reader = new StreamReader(File.OpenRead(path))) { var tracefile = Tracefile.FromTextReader(reader); return(new TracefileViewerViewModel(_selectionService, path, tracefile)); } }