示例#1
0
        protected VimTestBase()
        {
            _vim = CompositionContainer.GetExportedValue<IVim>();
            _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
            _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
            _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>();
            _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
            _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
            _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
            _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
            _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>();

            _clipboardDevice.Text = String.Empty;

            // One setting we do differ on for a default is 'timeout'.  We don't want them interferring
            // with the reliability of tests.  The default is on but turn it off here to prevent any
            // problems
            _vim.GlobalSettings.Timeout = false;

            // Don't let the personal VimRc of the user interfere with the unit tests
            _vim.AutoLoadVimRc = false;

            // Don't show trace information in the unit tests.  It really clutters the output in an
            // xUnit run
            VimTrace.TraceSwitch.Level = TraceLevel.Off;
        }
示例#2
0
        protected VimTestBase()
        {
            _vim = CompositionContainer.GetExportedValue <IVim>();
            _vimBufferFactory        = CompositionContainer.GetExportedValue <IVimBufferFactory>();
            _vimErrorDetector        = CompositionContainer.GetExportedValue <IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>();
            _wordUtilFactory         = CompositionContainer.GetExportedValue <IWordUtilFactory>();
            _bufferTrackingService   = CompositionContainer.GetExportedValue <IBufferTrackingService>();
            _foldManagerFactory      = CompositionContainer.GetExportedValue <IFoldManagerFactory>();
            _bulkOperations          = CompositionContainer.GetExportedValue <IBulkOperations>();
            _clipboardDevice         = CompositionContainer.GetExportedValue <IClipboardDevice>();
            _keyUtil = CompositionContainer.GetExportedValue <IKeyUtil>();

            _clipboardDevice.Text = String.Empty;

            // One setting we do differ on for a default is 'timeout'.  We don't want them interferring
            // with the reliability of tests.  The default is on but turn it off here to prevent any
            // problems
            _vim.GlobalSettings.Timeout = false;

            // Don't let the personal VimRc of the user interfere with the unit tests
            _vim.AutoLoadVimRc = false;

            // Don't show trace information in the unit tests.  It really clutters the output in an
            // xUnit run
            VimTrace.TraceSwitch.Level = TraceLevel.Off;
        }
示例#3
0
 protected VimTestBase()
 {
     _vim = CompositionContainer.GetExportedValue<IVim>();
     _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
     _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
     _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
     _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>();
     _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
     _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
     _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
     _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
     _protectedOperations = new ProtectedOperations(_vimErrorDetector);
 }
示例#4
0
        private long DoBulkInsert(string tableName, DataTable dataTable)
        {
            IBulkOperations bulkOps = BulkOperationsFactory.Create(_connection);

            bulkOps.Connection = _connection;
            bulkOps.TableName  = tableName;
            ValidateDatabaseTableStructure(tableName, dataTable);
            var countStart = CountRowsInTable(tableName);

            bulkOps.WriteToServer(dataTable);
            var countEnd = CountRowsInTable(tableName);

            return(countEnd - countStart);
        }
示例#5
0
        public VimEditorHost(CompositionContainer compositionContainer) : base(compositionContainer)
        {
            _vim = CompositionContainer.GetExportedValue <IVim>();
            _vimBufferFactory        = CompositionContainer.GetExportedValue <IVimBufferFactory>();
            _vimErrorDetector        = CompositionContainer.GetExportedValue <IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>();
            _bufferTrackingService   = CompositionContainer.GetExportedValue <IBufferTrackingService>();
            _foldManagerFactory      = CompositionContainer.GetExportedValue <IFoldManagerFactory>();
            _bulkOperations          = CompositionContainer.GetExportedValue <IBulkOperations>();
            _keyUtil             = CompositionContainer.GetExportedValue <IKeyUtil>();
            _protectedOperations = CompositionContainer.GetExportedValue <IProtectedOperations>();

            _keyboardDevice                 = CompositionContainer.GetExportedValue <IKeyboardDevice>();
            _mouseDevice                    = CompositionContainer.GetExportedValue <IMouseDevice>();
            _clipboardDevice                = CompositionContainer.GetExportedValue <IClipboardDevice>();
            _editorFormatMapService         = CompositionContainer.GetExportedValue <IEditorFormatMapService>();
            _classificationFormatMapService = CompositionContainer.GetExportedValue <IClassificationFormatMapService>();
        }
示例#6
0
        public VimEditorHost(CompositionContainer compositionContainer)
            : base(compositionContainer)
        {
            _vim = CompositionContainer.GetExportedValue<IVim>();
            _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
            _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
            _wordUtil = CompositionContainer.GetExportedValue<IWordUtil>();
            _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
            _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
            _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
            _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>();
            _vimProtectedOperations = CompositionContainer.GetExportedValue<IVimProtectedOperations>();

            _keyboardDevice = CompositionContainer.GetExportedValue<IKeyboardDevice>();
            _mouseDevice = CompositionContainer.GetExportedValue<IMouseDevice>();
            _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
        }
示例#7
0
        protected VimTestBase()
        {
            // Parts of the core editor in Vs2012 depend on there being an Application.Current value else
            // they will throw a NullReferenceException.  Create one here to ensure the unit tests successfully
            // pass
            if (Application.Current == null)
            {
                new Application();
            }

            _vim = CompositionContainer.GetExportedValue <IVim>();
            _vimBufferFactory        = CompositionContainer.GetExportedValue <IVimBufferFactory>();
            _vimErrorDetector        = CompositionContainer.GetExportedValue <IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>();
            _wordUtilFactory         = CompositionContainer.GetExportedValue <IWordUtilFactory>();
            _bufferTrackingService   = CompositionContainer.GetExportedValue <IBufferTrackingService>();
            _foldManagerFactory      = CompositionContainer.GetExportedValue <IFoldManagerFactory>();
            _bulkOperations          = CompositionContainer.GetExportedValue <IBulkOperations>();
            _keyUtil = CompositionContainer.GetExportedValue <IKeyUtil>();
            _vimProtectedOperations = CompositionContainer.GetExportedValue <IVimProtectedOperations>();

            _keyboardDevice       = CompositionContainer.GetExportedValue <IKeyboardDevice>();
            _mouseDevice          = CompositionContainer.GetExportedValue <IMouseDevice>();
            _clipboardDevice      = CompositionContainer.GetExportedValue <IClipboardDevice>();
            _clipboardDevice.Text = String.Empty;

            // One setting we do differ on for a default is 'timeout'.  We don't want them interfering
            // with the reliability of tests.  The default is on but turn it off here to prevent any
            // problems
            _vim.GlobalSettings.Timeout = false;

            // Don't let the personal VimRc of the user interfere with the unit tests
            _vim.AutoLoadVimRc = false;

            // Don't show trace information in the unit tests.  It really clutters the output in an
            // xUnit run
            VimTrace.TraceSwitch.Level = TraceLevel.Off;
        }
示例#8
0
        protected VimTestBase()
        {
            // Parts of the core editor in Vs2012 depend on there being an Application.Current value else
            // they will throw a NullReferenceException.  Create one here to ensure the unit tests successfully
            // pass
            if (Application.Current == null)
            {
                new Application();
            }

            _vim = CompositionContainer.GetExportedValue<IVim>();
            _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
            _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
            _wordUtil = CompositionContainer.GetExportedValue<IWordUtil>();
            _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
            _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
            _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
            _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>();
            _vimProtectedOperations = CompositionContainer.GetExportedValue<IVimProtectedOperations>();

            _keyboardDevice = CompositionContainer.GetExportedValue<IKeyboardDevice>();
            _mouseDevice = CompositionContainer.GetExportedValue<IMouseDevice>();
            _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
            _clipboardDevice.Text = String.Empty;

            // One setting we do differ on for a default is 'timeout'.  We don't want them interfering
            // with the reliability of tests.  The default is on but turn it off here to prevent any
            // problems
            _vim.GlobalSettings.Timeout = false;

            // Don't let the personal VimRc of the user interfere with the unit tests
            _vim.AutoLoadVimRc = false;

            // Don't show trace information in the unit tests.  It really clutters the output in an
            // xUnit run
            VimTrace.TraceSwitch.Level = TraceLevel.Off;
        }
示例#9
0
 public BulkOperationsTest()
 {
     _vimHost = new Mock<IVimHost>(MockBehavior.Loose);
     _bulkOperationsRaw = new BulkOperations(_vimHost.Object);
     _bulkOperations = _bulkOperationsRaw;
 }
示例#10
0
 public BulkOperationsTest()
 {
     _vimHost           = new Mock <IVimHost>(MockBehavior.Loose);
     _bulkOperationsRaw = new BulkOperations(_vimHost.Object);
     _bulkOperations    = _bulkOperationsRaw;
 }
示例#11
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
        public static CollectionSelect <T> Setup <T>(this IBulkOperations op, IEnumerable <T> collection)
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
        {
            return(op.Setup <T>(s => s.ForCollection(collection)));
        }
示例#12
0
        public override void SetupBase()
        {
            base.SetupBase();
            _vim = CompositionContainer.GetExportedValue<IVim>();
            _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
            _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
            _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>();
            _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
            _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
            _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
            _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
            _vimErrorDetector.Clear();
            _protectedOperations = new ProtectedOperations(_vimErrorDetector);
            _clipboardDevice.Text = String.Empty;

            // One setting we do differ on for a default is 'timeout'.  We don't want them interferring
            // with the reliability of tests.  The default is on but turn it off here to prevent any
            // problems
            _vim.GlobalSettings.Timeout = false;

            // Don't let the personal VimRc of the user interfere with the unit tests
            _vim.AutoLoadVimRc = false;

            _vim.VimData.LastShellCommand = FSharpOption<string>.None;
            _vim.VimData.LastCommand = FSharpOption<StoredCommand>.None;
        }