コード例 #1
0
 public TestTreeNode(string name, TestNodeType nodeType)
 {
     this.name     = name;
     this.nodeType = nodeType;
     this.state    = TestState.NotRun;
     this.nodes    = new TestTreeNodeCollection(this);
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestNode"/> class.
        /// </summary>
        /// <param name="text">The text of the node.</param>
        /// <param name="testNodeType">Type of the test node.</param>
        /// <param name="tagValue">The tag value.</param>
        /// <remarks>
        /// The <paramref name="tagValue"/> is put into the <see cref="TestNode.MethodInfo"/> field as
        /// <see cref="MethodInfo"/> or into the <see cref="ClrType"/>, when it is a <see cref="Type"/>.
        /// </remarks>
        public TestNode(string text, TestNodeType testNodeType, object tagValue)
        {
            Guard.NotNullOrEmpty(() => text, text);

            // this.Checked = @checked;
            this.Checked      = true;
            this.Text         = text;
            this.TestNodeType = testNodeType;

            if (tagValue is MethodInfo)
            {
                this.MethodInfo = tagValue as MethodInfo;
            }
            else if (tagValue is Type)
            {
                this.ClrType = tagValue as Type;
            }

            // <exception cref="ArgumentOutOfRangeException"><c>tagValue</c> is out of range, it has to be of
            // <see cref="MethodInfo"/> or <see cref="System.Type"/> type.</exception>

            /*else
             * {
             *  throw new ArgumentOutOfRangeException("tagValue", "The supplied tagValue has to be of MethodInfo or System.Type type.");
             * }*/
        }
コード例 #3
0
ファイル: TestTreeNode.cs プロジェクト: timonela/mb-unit
		public TestTreeNode(string name, TestNodeType nodeType)
		{
			this.name=name;
			this.nodeType = nodeType;
			this.state = TestState.NotRun;
			this.nodes = new TestTreeNodeCollection(this);
		}
コード例 #4
0
		public static void LoadAndSaveImage(TestNodeType nodeType, string outputPath)
		{
			using(Image img = LoadImage(nodeType))
			{
				string path = Path.Combine(outputPath,nodeType.ToString())+".png";
				img.Save(path);
			}
		}
コード例 #5
0
        /// <summary>
        /// Creates a <see cref="TestNode">TreeNode</see> with the
        /// given text and image key.
        /// </summary>
        /// <param name="text">The text of the TreeNode.</param>
        /// <param name="testNodeType">Type of the test node.</param>
        /// <param name="tag">The tag used as custom information storage.</param>
        /// <returns>A new node of the provided data.</returns>
        private TestNode CreateTreeNode(string text, TestNodeType testNodeType, object tag)
        {
            TestNode treeNode = new TestNode(text, testNodeType, tag);

            // treeNode.ImageIndex = this._objectIconsImageList.Images.IndexOfKey(imageKey);

            return(treeNode);
        }
コード例 #6
0
 public UnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
     : base(name)
 {
     this.testNodeType     = nodeType;
     this.domainIdentifier = domainIdentifier;
     this.testIdentifier   = testIdentifier;
     this.UpdateImageIndices();
 }
コード例 #7
0
 public static void LoadAndSaveImage(TestNodeType nodeType, string outputPath)
 {
     using (Image img = LoadImage(nodeType))
     {
         string path = Path.Combine(outputPath, nodeType.ToString()) + ".png";
         img.Save(path);
     }
 }
コード例 #8
0
 public UnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
     : base(name)
 {
     this.testNodeType = nodeType;
     this.domainIdentifier = domainIdentifier;
     this.testIdentifier = testIdentifier;
     this.UpdateImageIndices();
 }
コード例 #9
0
		public static Image LoadImage(TestNodeType nodeType)
		{
			Assembly a = Assembly.GetExecutingAssembly();
			string imgName = String.Format("MbUnit.Framework.Core.{0}.png",nodeType.ToString());
			Stream s = a.GetManifestResourceStream(imgName);

			// get icon
			Image icon = Image.FromStream(s);
			return icon;
		}
コード例 #10
0
        public static Image LoadImage(TestNodeType nodeType)
        {
            Assembly a       = Assembly.GetExecutingAssembly();
            string   imgName = String.Format("MbUnit.Framework.Core.{0}.png", nodeType.ToString());
            Stream   s       = a.GetManifestResourceStream(imgName);

            // get icon
            Image icon = Image.FromStream(s);

            return(icon);
        }
コード例 #11
0
ファイル: TaskRowModel.cs プロジェクト: default0/LoycCore
		public TaskRowModel(string name, TestNodeType type, ITaskEx task, bool delaySubscribeToTask)
		{
			_name = name;
			_type = type;
			_task = task;

			// Normally the TaskRowModel and task are created in the same AppDomain
			// and then the TaskRowModel is sent back to the main AppDomain. In this
			// case, we should not subscribe to PropertyChanged until deserialization.
			if (!delaySubscribeToTask) Subscribe();
		}
コード例 #12
0
        public TaskRowModel(string name, TestNodeType type, ITaskEx task, bool delaySubscribeToTask)
        {
            _name = name;
            _type = type;
            _task = task;

            // Normally the TaskRowModel and task are created in the same AppDomain
            // and then the TaskRowModel is sent back to the main AppDomain. In this
            // case, we should not subscribe to PropertyChanged until deserialization.
            if (!delaySubscribeToTask)
            {
                Subscribe();
            }
        }
コード例 #13
0
 public UnitTreeNode CreateNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
 {
     return(new UnitTreeNode(name, nodeType, domainIdentifier, testIdentifier));
 }
コード例 #14
0
 public static int ImageIndex(TestNodeType type, TestState state)
 {
     return((int)type * testStateCount + (int)state);
 }
コード例 #15
0
		public ContainerRowModel(string name, TestNodeType type, List<RowModel> children)
		{
			_name = name;
			_type = type;
			_children = children;
		}
コード例 #16
0
 public UnitTreeNode CreateUnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
 {
     return((UnitTreeNode)this.Invoke(this.createNode,
                                      new Object[] { name, nodeType, domainIdentifier, testIdentifier }
                                      ));
 }
コード例 #17
0
		public static int ImageIndex(TestNodeType type, TestState state)
		{
			return (int)type*testStateCount+(int)state;
		}
コード例 #18
0
ファイル: AssemblyFetcher.cs プロジェクト: Jedzia/NStub
        /// <summary>
        /// Creates a <see cref="TestNode">TreeNode</see> with the
        /// given text and image key.
        /// </summary>
        /// <param name="text">The text of the TreeNode.</param>
        /// <param name="testNodeType">Type of the test node.</param>
        /// <param name="tag">The tag used as custom information storage.</param>
        /// <returns>A new node of the provided data.</returns>
        private TestNode CreateTreeNode(string text, TestNodeType testNodeType, object tag)
        {
            TestNode treeNode = new TestNode(text, testNodeType, tag);
            // treeNode.ImageIndex = this._objectIconsImageList.Images.IndexOfKey(imageKey);

            return treeNode;
        }
コード例 #19
0
 public UnitTreeNode CreateUnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
 {
     return (UnitTreeNode)this.Invoke(this.createNode,
         new Object[]{name,nodeType,domainIdentifier,testIdentifier}
         );
 }
コード例 #20
0
 public UnitTreeNode CreateNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier)
 {
     return new UnitTreeNode(name, nodeType, domainIdentifier, testIdentifier);
 }
コード例 #21
0
 public ContainerRowModel(string name, TestNodeType type, List <RowModel> children)
 {
     _name     = name;
     _type     = type;
     _children = children;
 }