public void CreateIToolObject_RotateTool_Test() { ToolFactory target = new ToolFactory(); IDrawingFeatures drawingFeatures = new DrawingFeaturesMock(); string toolName = "RotateLeft90"; ITool actual; actual = target.CreateIToolObject(drawingFeatures, toolName); Assert.IsTrue(actual is RotateTool); }
public void ToolButton_Click(object sender, EventArgs e) { string name = (sender as Button).Name; ToolFactory toolFactory = new ToolFactory(); ITool tool = toolFactory.CreateIToolObject(_drawingFeatures, name); tool.Execute(); if (tool is AUndoable) { _drawingFeatures.DrawingHistory.History.Push((AUndoable)tool); } }