Пример #1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestGoodName()
        {
            Configuration conf = new Configuration();
            Type          test = WritableName.GetClass("long", conf);

            Assert.True(test != null);
        }
Пример #2
0
        /// <exception cref="System.Exception"/>
        public virtual void TestSetName()
        {
            Configuration conf = new Configuration();

            WritableName.SetName(typeof(TestWritableName.SimpleWritable), testName);
            Type test = WritableName.GetClass(testName, conf);

            Assert.True(test.Equals(typeof(TestWritableName.SimpleWritable)
                                    ));
        }
Пример #3
0
        /// <exception cref="System.Exception"/>
        public virtual void TestBadName()
        {
            Configuration conf = new Configuration();

            try
            {
                WritableName.GetClass("unknown_junk", conf);
                Assert.True(false);
            }
            catch (IOException e)
            {
                Assert.True(e.Message.Matches(".*unknown_junk.*"));
            }
        }
Пример #4
0
        /// <exception cref="System.Exception"/>
        public virtual void TestAddName()
        {
            Configuration conf    = new Configuration();
            string        altName = testName + ".alt";

            WritableName.SetName(typeof(TestWritableName.SimpleWritable), testName);
            WritableName.AddName(typeof(TestWritableName.SimpleWritable), altName);
            Type test = WritableName.GetClass(altName, conf);

            Assert.True(test.Equals(typeof(TestWritableName.SimpleWritable)
                                    ));
            // check original name still works
            test = WritableName.GetClass(testName, conf);
            Assert.True(test.Equals(typeof(TestWritableName.SimpleWritable)
                                    ));
        }