예제 #1
0
		public void Create(Type t, FixtureCollection fixtures)
		{
            MethodInfo mi =  this.GetMain(t,new Type[] { typeof(string[]) });
            if (mi == null)
                mi = this.GetMain(t,Type.EmptyTypes);
            if (mi == null)
                return;

            // create run
			SSCLIRun run = new SSCLIRun(mi, this.successReturnCode);
			Fixture fixture = new Fixture(t,run,null,null, false);
            fixtures.Add(fixture);
        }
        public void Create(Type t, FixtureCollection fixtures)
        {
            MethodInfo setUp = null;
            MethodInfo tearDown = null;
            bool setUpSearched = false;
            bool tearDownSearched=false;

            bool ignored = TypeHelper.HasCustomAttribute(t, typeof(IgnoreAttribute));

            foreach (TestFixturePatternAttribute attr in t.GetCustomAttributes(typeof(TestFixturePatternAttribute), true))
            {
                IRun run = null;
                try
                {
                    run = attr.GetRun();
                }
                catch (Exception ex)
                {
                    run = new FixtureFailedLoadingRun(t, ex);
                }
                if (!setUpSearched)
                {
                    setUp = TypeHelper.GetAttributedMethod(t, typeof(TestFixtureSetUpAttribute));
                    setUpSearched = true;
                }
                if (!tearDownSearched)
                {
                    tearDown = TypeHelper.GetAttributedMethod(t, typeof(TestFixtureTearDownAttribute));
                    tearDownSearched = true;
                }

                Fixture fixture = new Fixture(t, run, setUp, tearDown, ignored);
                fixture.TimeOut = attr.GetTimeOut();
                fixture.ApartmentState = attr.ApartmentState;
                fixtures.Add(fixture);
            }
        }
예제 #3
0
        public void Create(Type t, FixtureCollection fixtures)
        {
            if (!t.IsClass)
                return;
            if (t.IsAbstract)
                return;
            if (!t.Name.EndsWith(this.fixtureNameSuffix))
                return;


            MethodInfo setup = t.GetMethod(this.testFixtureSetUpName, Type.EmptyTypes);
            MethodInfo tearDown = t.GetMethod(this.testFixtureTearDownName, Type.EmptyTypes);

            Fixture fixture = new Fixture(t, this.run, setup, tearDown, false);
            fixtures.Add(fixture);
        }
예제 #4
0
파일: RunPipe.cs 프로젝트: timonela/mb-unit
		/// <summary>
		/// Default constructor - initializes all fields to default values
		/// </summary>
        public RunPipe(Fixture fixture)
        {
            if (fixture == null)
                throw new ArgumentNullException("fixture");
            this.fixture = fixture;
        }		
예제 #5
0
 public void TypeNullArgument()
 {
     Fixture fix = new Fixture(null, new MockRun(),null,null);
 }
예제 #6
0
 public void TypeNoDefaultArgument()
 {
     Fixture fix = new Fixture(typeof(NoDefaultConstructor), new MockRun(),null,null);
 }
예제 #7
0
 public void RunNullArgument()
 {
     Fixture fix = new Fixture(typeof(FixtureTest), null,null,null);
 }