Пример #1
0
        public void SetUp()
        {
            launcher = new ApplicationLauncher(TimeSpan.Parse("00:00:30"));

            application = launcher.LaunchOrRecycle("Example.PetShop", @"Examples\Wpf\Example.PetShop.exe", null);

            WindowFactory.ControlConstructor = new WindowFactory.ConstructFromElement((controlType, element, name) =>
            {

                Object[] parameters = new Object[2];

                parameters[0] = element;
                parameters[1] = name;

                return ReflectionHelper.Instantiate(controlType.Assembly, controlType.FullName, parameters);

            });
        }
Пример #2
0
        public void SetUp()
        {
            launcher = new ApplicationLauncher(TimeSpan.Parse("00:00:12"));

            application = launcher.LaunchOrRecycle("Example.PetShop.WinForms", @"Examples\WinForms\Example.PetShop.WinForms.exe", null);

            WindowFactory.ControlConstructor = new WindowFactory.ConstructFromElement((controlType, element, name) =>
            {

                if (controlType.Namespace.Contains("WiPFlash"))
                {

                    Object[] parameters = new Object[2];

                    parameters[0] = element;
                    parameters[1] = name;

                    return ReflectionHelper.Instantiate(controlType.Assembly, controlType.FullName, parameters);

                }
                else if (controlType.Namespace.Contains("TestStack.White"))
                {

                    Object[] parameters = new Object[2];

                    parameters[0] = element;
                    parameters[1] = new TestStack.White.UIItems.Actions.NullActionListener();

                    return ReflectionHelper.Instantiate(controlType.Assembly, controlType.FullName, parameters);

                }

                throw new CreatePlaceHeldControlFailedException(String.Format("Control Namespace Not Recognised!\nNamespace: {0}", controlType.Namespace), null);

            });
        }