public void AquirePosition(PositionAcquired newPosition)
        {
            if (newPosition == null)
            {
                throw new ArgumentNullException("newPosition");
            }

            if (newPosition.Price <= 0)
            {
                throw new ArgumentException("Price must be > 0 (zero)", "newPosition");
            }

            _state = _stateProvider.CalculateState(newPosition.Price, newPosition.Price);
        }
Exemple #2
0
        public void SetNextState(IStateProvider provider)
        {
            var state = provider.CalculateState(avatar);

            Assert.IsFalse(nextState, $"Attempted to transition to state {state}, but we're already scheduled to transition to {nextState}!");
            Assert.AreNotEqual(currentState, state, $"Attempted to transition to state {state}, but we're already in that state!");
            nextState = state;
        }