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)); } }
public Emulator() { _headsets = new List <HeadSet> { new Nokia3310(), new GalaxyS(), new Iphone6s() }; _currentHeadSet = null; }
public Emulator() { _headsets = new List <HeadSet> { new Nokia3310(), new GalaxyS(), new Iphone6s() }; _currentHeadSet = null; _observers = new List <ICallStatusObserver>(); }