Inheritance: ITestStateManager
Beispiel #1
0
 public TestInitializer(object testClass, TestStateManager testStateManager)
 {
     _typeToProcess = testClass.GetType();
     _testClass = testClass;
     _testStateManager = testStateManager;
     DetermineFields();
 }
Beispiel #2
0
 public TestInitializer(object testClass, TestStateManager testStateManager)
 {
     _typeToProcess    = testClass.GetType();
     _testClass        = testClass;
     _testStateManager = testStateManager;
     DetermineFields();
 }
Beispiel #3
0
        public void AddTest(TestStateManager testStateManager, Type type)
        {
            CurrentTest = testStateManager;

            var story = new Story((StoryAttribute)type.GetCustomAttributes(typeof(StoryAttribute), true).FirstOrDefault() ?? new StoryAttribute());

            if (!_stories.Any(x => x.Equals(story)))
                _stories.Add(story);

            story = _stories.First(x => x.Equals(story));
            story.AddTestStateManager(testStateManager);
        }
Beispiel #4
0
        protected Scenario()
        {
            var firstRun = !AlreadyRanDelegates.TryGetValue(GetType(), out _testStateManager);

            if (firstRun)
            {
                _testStateManager = new TestStateManager(this);
                var initializer = new TestInitializer(this, _testStateManager);
                initializer.ProcessDelegates();

                AlreadyRanDelegates.TryAdd(GetType(), _testStateManager);
            }
        }
Beispiel #5
0
        public void AddTest(TestStateManager testStateManager, Type type)
        {
            CurrentTest = testStateManager;

            var story = new Story((StoryAttribute)type.GetCustomAttributes(typeof(StoryAttribute), true).FirstOrDefault() ?? new StoryAttribute());

            if (!_stories.Any(x => x.Equals(story)))
            {
                _stories.Add(story);
            }

            story = _stories.First(x => x.Equals(story));
            story.AddTestStateManager(testStateManager);
        }
Beispiel #6
0
        public void Setup()
        {
            _testStateManager = new TestStateManager(this);
            var initializer = new TestInitializer(this,_testStateManager);

            //todo: there needs to be a common way to ignore setup for scenarios where all tests are ignored.  this sucks.
            if (!GetType().GetMethods().Any(y => new DefaultTestRunnerConfiguration().ThenIdentificationMethod(y) &&
                                                 !y.GetCustomAttributes(typeof (IgnoreAttribute), true).Any()))
            {
                return;
            }

            initializer.ProcessDelegates();
            _testStateManager.WriteSpecification();
        }
Beispiel #7
0
 public void AddTestStateManager(TestStateManager testStateManager)
 {
     _testManagers.Add(testStateManager);
 }
Beispiel #8
0
 protected Scenario()
 {
     _testStateManager = new TestStateManager(this);
     _initializer = new TestInitializer(this,_testStateManager);
     _initializer.ProcessDelegates();
 }