private void GetTypeToTestFromAUT()
        {
            if (applicationUT.Length <= 0)
            {
                return;
            }
            TypeUnderTest typeDUT = new TypeUnderTest();

            try
            {
                Assembly asm = Assembly.LoadFrom(applicationUT);
                Type[]   tys = asm.GetTypes();
                foreach (Type ty in tys)
                {
                    typeDUT.chckListType.Items.Add(ty.Namespace + "." + ty.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            if (typeDUT.ShowDialog() == DialogResult.OK)
            {
                GetSelectedTypesUT(typeDUT);
            }
            else
            {
                return;
            }
        }
示例#2
0
        private void GetTypeToTestFromAUT()
        {
            if (applicationUT.Length <= 0)
            {
                return;
            }
            TypeUnderTest typeDUT = new TypeUnderTest();

            try
            {
                Assembly asm = Assembly.LoadFrom(applicationUT);
                Type[]   tys = asm.GetTypes();
                foreach (Type ty in tys)
                {
                    typeDUT.chckListType.Items.Add(ty.Namespace + "." + ty.Name);
                }
            }
            //Chapter 14
            catch (BadImageFormatException badImgEx)
            {
                GUITestUtility.StartAUTAsProcess(applicationUT, "");

                applicationUT = null;
                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            if (typeDUT.ShowDialog() == DialogResult.OK)
            {
                GetSelectedTypesUT(typeDUT);
            }
            else
            {
                return;
            }
        }