コード例 #1
0
 /// <summary>
 /// Configures the sample test runner according to the declared [RunSample] attributes decorating the test fixture.
 /// </summary>
 protected virtual void ConfigureRunner()
 {
     foreach (RunSampleAttribute attrib in GetType().GetCustomAttributes(typeof(RunSampleAttribute), true))
     {
         if (attrib.MethodName.Length == 0)
         {
             runner.AddFixture(attrib.FixtureType);
         }
         else
         {
             runner.AddMethod(attrib.FixtureType, attrib.MethodName);
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// Configures the test runner.
        /// </summary>
        protected virtual void ConfigureRunner()
        {
            foreach (RunSampleAttribute attrib in GetType().GetCustomAttributes(typeof(RunSampleAttribute), true))
            {
                if (attrib.MethodName == null)
                {
                    runner.AddFixture(attrib.FixtureType);
                }
                else
                {
                    runner.AddMethod(attrib.FixtureType, attrib.MethodName);
                }
            }

            foreach (RunSampleFileAttribute attrib in GetType().GetCustomAttributes(typeof(RunSampleFileAttribute), true))
            {
                runner.AddFile(new FileInfo(attrib.FilePath));
            }
        }