Beispiel #1
0
        public void TestThatBitmapManagerSetsCorrectTool()
        {
            BitmapManager bitmapManager = new BitmapManager();

            bitmapManager.SetActiveTool(new MockedSinglePixelPen());
            Assert.Equal(ToolType.Pen, bitmapManager.SelectedTool.ToolType);
        }
        public void TestThatBitmapManagerSetsCorrectTool()
        {
            BitmapManager bitmapManager = new BitmapManager();

            bitmapManager.SetActiveTool(new MockedSinglePixelPenTool());
            Assert.Equal(typeof(MockedSinglePixelPenTool), bitmapManager.SelectedTool.GetType());
        }
Beispiel #3
0
        public void TestThatBitmapChangesExecuteToolExecutesPenTool()
        {
            BitmapManager bitmapManager = new BitmapManager
            {
                ActiveDocument = new Document(5, 5)
            };

            bitmapManager.AddNewLayer("Layer");
            bitmapManager.SetActiveTool(new MockedSinglePixelPen());
            bitmapManager.PrimaryColor = Colors.Green;

            bitmapManager.MouseController.StartRecordingMouseMovementChanges(true);
            bitmapManager.MouseController.RecordMouseMovementChange(new Coordinates(1, 1));
            bitmapManager.MouseController.StopRecordingMouseMovementChanges();

            bitmapManager.ExecuteTool(new Coordinates(1, 1), true);

            Assert.Equal(Colors.Green, bitmapManager.ActiveLayer.GetPixelWithOffset(1, 1));
        }