Esempio n. 1
0
        public void RecordMacroTest()
        {
            var tmpMacFile = File.CreateTemporaryFile(".mac");

            tmpMacFile.Delete();

            try
            {
                _powerSHAPE.RecordMacro(tmpMacFile.Path);

                _powerSHAPE.Execute("PRINT 'fred'");

                _powerSHAPE.StopMacroRecording();

                Assert.True(tmpMacFile.Exists, "macro file should exist");

                var lines = System.IO.File.ReadAllLines(tmpMacFile.Path);

                if (lines == null || lines.Length < 1)
                {
                    Assert.Fail("Macro file is empty");
                }

                _powerSHAPE.Reset();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
            finally
            {
                _powerSHAPE.Reset();
                tmpMacFile.Delete();
            }
        }