public bool OrderCondiment(CondimentType condimentType, int quantity) { if (_currentCup == null) { return(false); } ICondimentService service = _condimentServiceFactory.Create(condimentType); if (!service.IsCondimentValid(quantity)) { return(false); } if (_currentCup.Condiments.ContainsKey(condimentType)) { _currentCup.Condiments.Remove(condimentType); } var condiment = service.OrderCondiment(quantity); _currentCup.Condiments.Add(condimentType, condiment); return(true); }
public void SetUp() { _appSettingsMock = new Mock <IApplicationSettingsService>(); _service = new CreamService(_appSettingsMock.Object); }