SafeToDoMacro() private method

private SafeToDoMacro ( IVwSelection sel, ICmObject &obj, int &flid, int &ws, int &start, int &length ) : bool
sel IVwSelection
obj ICmObject
flid int
ws int
start int
length int
return bool
Ejemplo n.º 1
0
        public void SafeToDoMacro_WithNoSelection_ReturnsFalse()
        {
            var       ml = new MacroListener();
            int       ichA, hvoA, flid, ws, ichE, start, length;
            ICmObject obj;

            Assert.That(ml.SafeToDoMacro(null, out obj, out flid, out ws, out start, out length), Is.False);
        }
Ejemplo n.º 2
0
        public void SafeToDoMacro_WithUnsuitableSelection_ReturnsFalse()
        {
            var ml  = new MacroListener();
            var sel = new MockSelection();

            sel.EndHvo    = sel.AnchorHvo = 317;
            sel.EndTag    = sel.AnchorTag = LexEntryTags.kflidRestrictions;          // arbitrary in this case
            sel.EndIch    = 2;
            sel.AnchorIch = 5;
            int       ichA, hvoA, flid, ws, ichE, start, length;
            ICmObject obj;

            Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False);             // wrong type of selection

            sel.TypeToReturn = VwSelType.kstText;
            sel.EndHvo       = 316;
            Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False);             // different objects

            sel.EndHvo = sel.AnchorHvo;
            sel.EndTag = 3;
            Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False);             // different tags
        }
Ejemplo n.º 3
0
		public void SafeToDoMacro_WithUnsuitableSelection_ReturnsFalse()
		{
			var ml = new MacroListener();
			var sel = new MockSelection();
			sel.EndHvo = sel.AnchorHvo = 317;
			sel.EndTag = sel.AnchorTag = LexEntryTags.kflidRestrictions; // arbitrary in this case
			sel.EndIch = 2;
			sel.AnchorIch = 5;
			int ichA, hvoA, flid, ws, ichE, start, length;
			ICmObject obj;

			Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False); // wrong type of selection

			sel.TypeToReturn = VwSelType.kstText;
			sel.EndHvo = 316;
			Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False); // different objects

			sel.EndHvo = sel.AnchorHvo;
			sel.EndTag = 3;
			Assert.That(ml.SafeToDoMacro(sel, out obj, out flid, out ws, out start, out length), Is.False); // different tags
		}
Ejemplo n.º 4
0
		public void SafeToDoMacro_WithNoSelection_ReturnsFalse()
		{
			var ml = new MacroListener();
			int ichA, hvoA, flid, ws, ichE, start, length;
			ICmObject obj;
			Assert.That(ml.SafeToDoMacro(null, out obj, out flid, out ws, out start, out length), Is.False);
		}