예제 #1
0
        public void TestPythiaFullFile()
        {
            var f = new FileInfo("full-mcfile.root");
            Assert.IsTrue(f.Exists, "input file is there");
            var testit = new ParseTFile();
            var r = testit.ParseFile(f).ToArray();

            // This next line will throw if the classes have the same name.
            var classMap = r.ToDictionary(c => c.Name, c => c);
            Assert.IsFalse(r.Where(c => c.Items.Where(i => i.Name.Contains(":")).Any()).Any(), "Bad C# name in item name");
            Assert.IsFalse(r.Where(c => c.Items.Where(i => i.ItemType.Contains(":")).Any()).Any(), "Bad C# name in item type");
            Assert.IsFalse(r.Where(c => c.Name.Contains(":")).Any(), "Bad C# name");
        }
예제 #2
0
        public void TestPythiaFullFile()
        {
            var f = new FileInfo("full-mcfile.root");

            Assert.IsTrue(f.Exists, "input file is there");
            var testit = new ParseTFile();
            var r      = testit.ParseFile(f).ToArray();

            // This next line will throw if the classes have the same name.
            var classMap = r.ToDictionary(c => c.Name, c => c);

            Assert.IsFalse(r.Where(c => c.Items.Where(i => i.Name.Contains(":")).Any()).Any(), "Bad C# name in item name");
            Assert.IsFalse(r.Where(c => c.Items.Where(i => i.ItemType.Contains(":")).Any()).Any(), "Bad C# name in item type");
            Assert.IsFalse(r.Where(c => c.Name.Contains(":")).Any(), "Bad C# name");
        }
예제 #3
0
        public void TestMCObjectsWithFunnyNames()
        {
            var f = new FileInfo("atest.root");

            Assert.IsTrue(f.Exists, "File not there");

            var p       = new ParseTFile();
            var results = p.ParseFile(f).ToArray();

            foreach (var c in results)
            {
                Console.WriteLine("Class " + c.Name);
                Assert.IsFalse(c.Name.Contains("."), string.Format("Class {0} contains bad characters", c.Name));
                foreach (var item in c.Items)
                {
                    Console.WriteLine("  item " + item.Name + " - " + item.ItemType);
                    Assert.IsFalse(item.Name.Contains("."), string.Format("Object {0} contains item {1}", c.Name, item.Name));
                    Assert.IsFalse(item.Name.Contains(":"), string.Format("Object {0} contains item {1}", c.Name, item.Name));
                }
            }
        }
예제 #4
0
        public void TestMCObjectsWithFunnyNames()
        {
            var f = new FileInfo("atest.root");
            Assert.IsTrue(f.Exists, "File not there");

            var p = new ParseTFile();
            var results = p.ParseFile(f).ToArray();

            foreach (var c in results)
            {
                Console.WriteLine("Class " + c.Name);
                Assert.IsFalse(c.Name.Contains("."), string.Format("Class {0} contains bad characters", c.Name));
                foreach (var item in c.Items)
                {
                    Console.WriteLine("  item " + item.Name + " - " + item.ItemType);
                    Assert.IsFalse(item.Name.Contains("."), string.Format("Object {0} contains item {1}", c.Name, item.Name));
                    Assert.IsFalse(item.Name.Contains(":"), string.Format("Object {0} contains item {1}", c.Name, item.Name));
                }
            }
        }