public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsPositiveAndAtTabStop_AdvancesWholeWidth(bool negativeX)
        {
            int xShift = negativeX ? -120 : 0;
            var ruler  = new PixelTabStopRuler(30, 10);

            Assert.AreEqual(xShift + 60, ruler.AdvanceToNextTabStop(xShift + 30));
        }
        public void Constructor_WhenArgumentsValid_SetsProperties(int pixelsPerTabStop, int minimumTabWidth)
        {
            var ruler = new PixelTabStopRuler(pixelsPerTabStop, minimumTabWidth);

            Assert.AreEqual(pixelsPerTabStop, ruler.PixelsPerTabStop);
            Assert.AreEqual(minimumTabWidth, ruler.MinimumTabWidth);
        }
Exemplo n.º 3
0
        public void TabStopRuler_SetGet()
        {
            var builder = new StyleBuilder();
            var ruler   = new PixelTabStopRuler(30, 10);

            builder.TabStopRuler = ruler;
            Assert.AreEqual(ruler, builder.TabStopRuler.Value);

            Assert.Throws <ArgumentNullException>(() => builder.TabStopRuler = null);
        }
 public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsPositiveAndPastTabStopButLessThanMinimumWidthAway_AdvancesAnExtraTabStop(bool negativeX)
 {
     int xShift = negativeX ? -120 : 0;
     var ruler = new PixelTabStopRuler(30, 10);
     Assert.AreEqual(xShift + 90, ruler.AdvanceToNextTabStop(xShift + 55));
 }
 public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsPositiveAndPastTabStopAndExactlyMinimumWidthAway_AdvancesOneTabStop(bool negativeX)
 {
     int xShift = negativeX ? -120 : 0;
     var ruler = new PixelTabStopRuler(30, 10);
     Assert.AreEqual(xShift + 60, ruler.AdvanceToNextTabStop(xShift + 50));
 }
 public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsPositiveAndAtTabStop_AdvancesWholeWidth(bool negativeX)
 {
     int xShift = negativeX ? -120 : 0;
     var ruler = new PixelTabStopRuler(30, 10);
     Assert.AreEqual(xShift + 60, ruler.AdvanceToNextTabStop(xShift + 30));
 }
 public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsZero_AdvancesMinimumWidth()
 {
     var ruler = new PixelTabStopRuler(0, 10);
     Assert.AreEqual(52, ruler.AdvanceToNextTabStop(42));
 }
 public void Constructor_WhenArgumentsValid_SetsProperties(int pixelsPerTabStop, int minimumTabWidth)
 {
     var ruler = new PixelTabStopRuler(pixelsPerTabStop, minimumTabWidth);
     Assert.AreEqual(pixelsPerTabStop, ruler.PixelsPerTabStop);
     Assert.AreEqual(minimumTabWidth, ruler.MinimumTabWidth);
 }
Exemplo n.º 9
0
        public void TabStopRuler_SetGet()
        {
            var builder = new StyleBuilder();
            var ruler = new PixelTabStopRuler(30, 10);
            builder.TabStopRuler = ruler;
            Assert.AreEqual(ruler, builder.TabStopRuler.Value);

            Assert.Throws<ArgumentNullException>(() => builder.TabStopRuler = null);
        }
Exemplo n.º 10
0
        public void AdvanceToNextTabStop_WhenPixelsPerTabStopIsZero_AdvancesMinimumWidth()
        {
            var ruler = new PixelTabStopRuler(0, 10);

            Assert.AreEqual(52, ruler.AdvanceToNextTabStop(42));
        }