Ejemplo n.º 1
0
 public VBEnumMember(Enumeration.EnumMember obj)
 {
     this.obj = obj;
 }
        public void EnumMember()
        {
            Enumeration en = new Enumeration(controller, "FileTypes");
            Enumeration.EnumMember item = new Enumeration.EnumMember(controller, "CSharp");
            Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("CSharp"));
            en.AddChild(item);

            Class cl = new Class(controller, "Class1");
            cl.AddChild(en);

            Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("Class1.FileTypes.CSharp"));
        }
        public void EnumMember_ChangedValue()
        {
            const string memberName = "MyMemberName1";
            const string memberValue1 = "MyValue1";
            const string memberValue2 = "MyValue2";
            string expectedResult = String.Format("{0} = {1}", memberName, memberValue2);

            Enumeration.EnumMember merged1 = new Enumeration.EnumMember(controller, memberName);
            Enumeration.EnumMember merged2 = new Enumeration.EnumMember(controller, memberName);
            Enumeration.EnumMember merged3 = new Enumeration.EnumMember(controller, memberName);

            Enumeration.EnumMember changing = new Enumeration.EnumMember(controller, memberName, memberValue2);
            Enumeration.EnumMember unchanging = new Enumeration.EnumMember(controller, memberName, memberValue1);

            Merge_And_Assert(merged1, merged2, merged3, changing, unchanging, expectedResult);
        }
Ejemplo n.º 4
0
        private void Process_Enum_Member_Declaration(EnumerationMemberDeclaration node)
        {
            if (node == null) throw new ArgumentNullException("node");

            Enumeration.EnumMember enumMember = new Enumeration.EnumMember(controller, node.Name.Text);
            if (node.Initializer != null)
                enumMember.Value = formatter.FormatExpression(node.Initializer);

            SetupBaseConstruct(node, enumMember);
        }