Example #1
0
        public void AssertThat_HandlerInDifferentAssembly_NotAdded_NoChanges()
        {
            var expected = 0;

            var conf = new Additional.TestConfiguration()
            {
                id = 1234
            };
            var va          = Helpers.InitializeTestVA(conf);
            var environment = va.CreateEventHandlerEnvironment(MFilesAPI.MFEventHandlerType.MFEventHandlerBeforeCreateNewObjectFinalize);
            var command     = new EventCommand(environment);

            Dispatcher dispatcher = va.EventDispatcher;

            dispatcher.Dispatch(command);

            Assert.AreEqual(expected, environment.CurrentUserID);
        }
Example #2
0
        public void SpeedTest_AdditionalAssembly_100000Calls()
        {
            var conf = new Additional.TestConfiguration()
            {
                id = 1234
            };
            var environment = new EventHandlerEnvironment();
            var command     = new EventCommand(environment);

            var va = Helpers.InitializeTestVA(conf);

            var dispatcher = va.EventDispatcher;

            dispatcher.IncludeAssemblies(typeof(Additional.TestConfiguration).Assembly);

            for (int i = 0; i < 100000; i++)
            {
                dispatcher.Dispatch(command);
            }

            Assert.IsTrue(true);
        }