Пример #1
0
 public void Update(string text, [CanBeNull] string explicitReason, IEnumerable <UnitTestElementCategory> categories)
 {
     _text           = text;
     _explicitReason = explicitReason;
     _categories     = categories;
     _state          = UnitTestElementState.Valid;
 }
Пример #2
0
        private UnitTestElementState GetState(UnitTestElementState currentState, UnitTestElementState newState)
        {
            if (newState == UnitTestElementState.Valid && currentState == UnitTestElementState.PendingDynamic)
            {
                return(UnitTestElementState.Dynamic);
            }

            if ((currentState == UnitTestElementState.Dynamic || currentState == UnitTestElementState.PendingDynamic) &&
                (newState == UnitTestElementState.Valid || newState == UnitTestElementState.Pending))
            {
                throw new Exception(string.Format("Current state {0} unable to turn into {1}", currentState, newState));
            }

            return(newState);
        }
Пример #3
0
        public UnitTestElementDisposition GetDispositionFromFiles(params ITestFile[] testFiles)
        {
            var declarations = testFiles
                               .Select(x => x.TestDeclarations.Search(Identity, y => y.TestDeclarations))
                               .WhereNotNull().ToList();

            var locations = declarations.Select(x => x.GetTestElementLocation()).ToList();

            if (locations.Count != 0)
            {
                return(new UnitTestElementDisposition(locations, this));
            }

            if (_state == UnitTestElementState.Dynamic || _state == UnitTestElementState.PendingDynamic)
            {
                return(UnitTestElementDisposition.NotYetClear(this));
            }

            _state = UnitTestElementState.Invalid;
            return(UnitTestElementDisposition.InvalidDisposition);
        }
Пример #4
0
 // Simply to get around the virtual call in ctor warning
 protected void SetState(UnitTestElementState state)
 {
     State = state;
 }
Пример #5
0
        private UnitTestElementState GetState(UnitTestElementState currentState, UnitTestElementState newState)
        {
            if (newState == UnitTestElementState.Valid && currentState == UnitTestElementState.PendingDynamic)
            return UnitTestElementState.Dynamic;

              if ((currentState == UnitTestElementState.Dynamic || currentState == UnitTestElementState.PendingDynamic) &&
              (newState == UnitTestElementState.Valid || newState == UnitTestElementState.Pending))
              {
            throw new Exception(string.Format("Current state {0} unable to turn into {1}", currentState, newState));
              }

              return newState;
        }
Пример #6
0
 public void Update(string text, [CanBeNull] string explicitReason, IEnumerable<UnitTestElementCategory> categories)
 {
     _text = text;
       _explicitReason = explicitReason;
       _categories = categories;
       _state = UnitTestElementState.Valid;
 }
Пример #7
0
        public UnitTestElementDisposition GetDispositionFromFiles(params ITestFile[] testFiles)
        {
            var declarations = testFiles
              .Select(x => x.TestDeclarations.Search(Identity, y => y.TestDeclarations))
              .WhereNotNull().ToList();

              var locations = declarations.Select(GetUnitTestElementLocation).ToList();
              if (locations.Count != 0)
            return new UnitTestElementDisposition(locations, this);

              if (_state == UnitTestElementState.Dynamic || _state == UnitTestElementState.PendingDynamic)
            return UnitTestElementDisposition.NotYetClear(this);

              _state = UnitTestElementState.Invalid;
              return UnitTestElementDisposition.InvalidDisposition;
        }
 // Simply to get around the virtual call in ctor warning
 protected void SetState(UnitTestElementState state)
 {
     State = state;
 }