Ejemplo n.º 1
0
        public void SetCurrentHeadset(string model)
        {
            if (string.IsNullOrWhiteSpace(model))
            {
                throw new ArgumentException("The given model is null or empty", nameof(model));
            }
            HeadSet localHeadSet = null;

            foreach (HeadSet cell in _headsets)
            {
                if (model == cell.Model)
                {
                    localHeadSet = cell;
                    break;
                }
            }

            if (localHeadSet != null)
            {
                _currentHeadSet = localHeadSet;
            }
            else
            {
                throw new ArgumentException($"The given model [{model}] is invalid", nameof(model));
            }
        }
Ejemplo n.º 2
0
        public Emulator()
        {
            _headsets = new List <HeadSet>
            {
                new Nokia3310(),
                new GalaxyS(),
                new Iphone6s()
            };

            _currentHeadSet = null;
        }
Ejemplo n.º 3
0
        public Emulator()
        {
            _headsets = new List <HeadSet>
            {
                new Nokia3310(),
                new GalaxyS(),
                new Iphone6s()
            };

            _currentHeadSet = null;
            _observers      = new List <ICallStatusObserver>();
        }