public void Can_Disable_ShowCurrentLine() { TestingRenderer renderer = new TestingRenderer(); _box = new TestingCodeBox(new GeneralCodeFormatter(), renderer); _box.Text = "line 1\r\nline 2\r\nline 3\r\n"; _box.ShowCurrentLine = true; _box.CurrentLine = 1; _box.FireOnPaint(); Assert.That(renderer.CURRENTLINE_INDEX, Is.EqualTo(1)); _box.ShowCurrentLine = false; _box.FireOnPaint(); Assert.That(renderer.CURRENTLINE_INDEX, Is.EqualTo(-1)); _box.ShowCurrentLine = true; _box.FireOnPaint(); Assert.That(renderer.CURRENTLINE_INDEX, Is.EqualTo(1)); return; }
public void OnPaint() { TestingCodeBox box = SetupCodeBox(_someText, new SizeF(300, 400)); box.Width = 150; box.Height = 150; box.FireOnPaint(); _mockRenderer.Received().DrawToGraphics(_someText, box.RenderingContext, new Rectangle(0, 0, 150, 150)); return; }
public void OnPaint() { TestingCodeBox box = SetupCodeBox(_someText, new SizeF(300, 400)); box.Width = 150; box.Height = 150; _mockRenderer.Expect("DrawToGraphics", new object[] { _someText, box.RenderingContext, new Rectangle(0, 0, 150, 150) }); box.FireOnPaint(); _mockRenderer.Verify(); return; }