예제 #1
0
        public void TestPublicAbstractClass()
        {
            AssemblyBrowserLib.NodableNamespace nodableNamespace = nodableStructure.Where(nodable => nodable.GetName == "Lab3PuppetAssembly").ToList()[0] as AssemblyBrowserLib.NodableNamespace;
            var children = nodableNamespace.GetChildren;
            IList <AssemblyBrowserLib.Nodable> nodables = children.Where(nodable => nodable.GetName == "PublicAbstractClass").ToList();

            Assert.IsTrue(nodables.Count == 1);
            var nodableClass = nodables.First() as AssemblyBrowserLib.NodableClass;
            var attributes   = nodableClass.GetAttributes();

            Assert.IsTrue(attributes.Contains("public"));
            Assert.IsTrue(attributes.Contains("abstract"));
            var classChildren = nodableClass.GetChildren;

            Assert.IsTrue(classChildren.Count == 2);
        }
예제 #2
0
        public void TestPublicAbstractClass()
        {
            AssemblyBrowserLib.NodableNamespace nodableNamespace = nodableStructure.Where(nodable => nodable.GetName == "AssemblyBrowserLib").ToList()[0] as AssemblyBrowserLib.NodableNamespace;
            var children = nodableNamespace.GetChildren;
            IList <AssemblyBrowserLib.Nodable> nodables = children.Where(nodable => nodable.GetName == "PublicAbstractClass").ToList();

            nodables.Add(new AssemblyBrowserLib.Nodable());
            Assert.IsTrue(nodables.Count == 1);
            AssemblyBrowserLib.NodableClass nodableClass = null;
            try
            {
                nodableClass = nodables.First() as AssemblyBrowserLib.NodableClass;
            }catch { }
            string str1 = "public"; string str2 = "abstract"; List <string> attributes = new List <string> {
                str1, str2
            };

            Assert.IsTrue(attributes.Contains("public"));
            Assert.IsTrue(attributes.Contains("abstract"));
        }