public void execTest3()
        {
            DTEOperationAccessor.ToExec target = new DTEOperationAccessor.ToExec(2);

            Queue <DTEOperation.DTEPrepared> commands = new Queue <DTEOperation.DTEPrepared>();

            commands.Enqueue(new DTEOperation.DTEPrepared("Build.Cancel", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("File.OpenProject", "app.sln"));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.Start", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.StartWithoutDebugging", ""));

            DTEOperation.DTEPrepared[] expected = new DTEOperation.DTEPrepared[commands.Count];
            commands.CopyTo(expected, 0);

            try {
                target.exec(commands, true);
            }
            catch (ExternalException) {
                // other type should fail the current test
            }

            Queue <DTEOperation.DTEPrepared> actual = target.getExecuted();

            Assert.IsTrue(actual.Count != expected.Length);
            Assert.IsTrue(actual.Count == 2);

            int idx = 0;

            foreach (DTEOperation.DTEPrepared obj in actual)
            {
                Assert.AreEqual(expected[idx++], obj);
            }
        }
        public void execTest2()
        {
            DTEOperationAccessor.ToExec target = new DTEOperationAccessor.ToExec(1);

            Queue <DTEOperation.DTEPrepared> commands = new Queue <DTEOperation.DTEPrepared>();

            commands.Enqueue(new DTEOperation.DTEPrepared("Build.Cancel", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("File.OpenProject", "app.sln"));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.Start", ""));

            DTEOperation.DTEPrepared[] expected = new DTEOperation.DTEPrepared[commands.Count];
            commands.CopyTo(expected, 0);

            try {
                target.exec(commands, false);
            }
            catch (ComponentException) {
                // other type should fail the current test
            }

            Queue <DTEOperation.DTEPrepared> actual = target.getExecuted();

            Assert.IsTrue(actual.Count == expected.Length);

            foreach (DTEOperation.DTEPrepared obj in expected)
            {
                Assert.AreEqual(actual.Dequeue(), obj);
            }
        }
Beispiel #3
0
        public void execTest3()
        {
            DTEOperationAccessor.ToExec target = new DTEOperationAccessor.ToExec(2);

            Queue<DTEOperation.DTEPrepared> commands = new Queue<DTEOperation.DTEPrepared>();
            commands.Enqueue(new DTEOperation.DTEPrepared("Build.Cancel", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("File.OpenProject", "app.sln"));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.Start", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.StartWithoutDebugging", ""));

            DTEOperation.DTEPrepared[] expected = new DTEOperation.DTEPrepared[commands.Count];
            commands.CopyTo(expected, 0);

            try {
                target.exec(commands, true);
            }
            catch(ComponentException) {
                // other type should fail the current test
            }

            Queue<DTEOperation.DTEPrepared> actual = target.getExecuted();
            Assert.IsTrue(actual.Count != expected.Length);
            Assert.IsTrue(actual.Count == 2);

            int idx = 0;
            foreach(DTEOperation.DTEPrepared obj in actual) {
                Assert.AreEqual(expected[idx++], obj);
            }
        }
Beispiel #4
0
        public void execTest()
        {
            DTEOperationAccessor.ToExec target = new DTEOperationAccessor.ToExec(-1);

            Queue<DTEOperation.DTEPrepared> commands = new Queue<DTEOperation.DTEPrepared>();
            commands.Enqueue(new DTEOperation.DTEPrepared("Build.Cancel", ""));
            commands.Enqueue(new DTEOperation.DTEPrepared("File.OpenProject", "app.sln"));
            commands.Enqueue(new DTEOperation.DTEPrepared("Debug.Start", ""));

            DTEOperation.DTEPrepared[] expected = new DTEOperation.DTEPrepared[commands.Count];
            commands.CopyTo(expected, 0);

            target.exec(commands, false);

            Queue<DTEOperation.DTEPrepared> actual = target.getExecuted();
            Assert.IsTrue(actual.Count == expected.Length);

            foreach(DTEOperation.DTEPrepared obj in expected) {
                Assert.AreEqual(actual.Dequeue(), obj);
            }
        }