示例#1
0
        public static CecilTestSuite CreateTestSuite(MethodInfo method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            var suite = new CecilTestSuite(method);

            NUnitFramework.ApplyCommonAttributes(method, suite);
            PopulateTestSuite(method, suite);

            return(suite);
        }
示例#2
0
        static void PopulateTestSuite(MethodInfo method, CecilTestSuite suite)
        {
            var attribute = GetTestCecilAttribute(method);

            if (attribute == null)
            {
                throw new ArgumentException();
            }

            foreach (var value in Enum.GetValues(typeof(TestCaseType)))
            {
                var test = CreateTestCase(method, attribute, (TestCaseType)value);
                if (test != null)
                {
                    suite.Add(test);
                }
            }
        }
示例#3
0
		static void PopulateTestSuite (MethodInfo method, CecilTestSuite suite)
		{
			var attribute = GetTestCecilAttribute (method);
			if (attribute == null)
				throw new ArgumentException ();

			foreach (var value in Enum.GetValues (typeof (TestCaseType))) {
				var test = CreateTestCase (method, attribute, (TestCaseType) value);
				if (test != null)
					suite.Add (test);
			}
		}
示例#4
0
		public static CecilTestSuite CreateTestSuite (MethodInfo method)
		{
			if (method == null)
				throw new ArgumentNullException ("method");

			var suite = new CecilTestSuite (method);

			NUnitFramework.ApplyCommonAttributes (method, suite);
			PopulateTestSuite (method, suite);

			return suite;
		}