static ITestResultMethod runMethodTest( ITestResultFactory resultFactory, IDrawingBackend drawingBackend, TestMethod testMethod, Action <IDrawingTarget> action) { var attribute = testMethod.Attribute; var width = attribute.Width; var height = attribute.Height; using (var target = drawingBackend.CreateBitmapDrawingSurface(width, height)) { ITestResultReport testReport; using (var drawingTarget = target.BeginDraw()) { action(drawingTarget); testReport = resultFactory.Report(drawingTarget.Reports); } var bitmap = resultFactory.Bitmap(width, height, target.ExtractRawBitmap()); return(resultFactory.Method(testMethod.Info.Name, bitmap, testReport)); } }
static ITestResultMethod runMethodTest( ITestResultFactory resultFactory, IDrawingBackend drawingBackend, TestMethod testMethod, Action<IDrawingTarget> action) { var attribute = testMethod.Attribute; var width = attribute.Width; var height = attribute.Height; using (var target = drawingBackend.CreateBitmapDrawingSurface(width, height)) { ITestResultReport testReport; using (var drawingTarget = target.BeginDraw()) { action(drawingTarget); testReport = resultFactory.Report(drawingTarget.Reports); } var bitmap = resultFactory.Bitmap(width, height, target.ExtractRawBitmap()); return resultFactory.Method(testMethod.Info.Name, bitmap, testReport); } }