public EventService(ICoffeeService coffeeBreakService, ISlursCommands slurs, IGovernmentRepository governmentRepository, IGovernmentService governmentService) { _coffeeBreakService = coffeeBreakService; _slurs = slurs; _governmentRepository = governmentRepository; _governmentService = governmentService; }
static void Main(string[] args) { // Ideally this would be handled via an IOC container of some sort like autofac // in the interest of time I'm handling it manually here _appSettings = new ApplicationSettingsService(); _condimentServiceFactory = new CondimentServiceFactory(_appSettings); _paymentService = new PaymentService(); _coffeeService = new CoffeeService(_condimentServiceFactory, _paymentService, _appSettings); while (true) { string input = MainMenu(); switch (input.ToLowerInvariant()) { case "1": OrderCoffee(); break; case "2": ReviewOrder(); break; case "3": CancelOrder(); break; case "4": Pay(); break; case "q": return; } } }
public CoffeeListViewModel(ICoffeeService coffeeService, IFavoriteService favoriteService) { this.favoriteService = favoriteService; this.coffeeService = coffeeService; this.AllCoffees = new ObservableCollection <CoffeeShop> (); this.FavoriteCoffees = new ObservableCollection <CoffeeShop> (); }
public CoffeeCommands(ICoffeeRepository coffeeRepository, IUserRepository userRepository, ISlackWebApi messageSender, IAuthorizationService adminValidator, ICoffeeService coffeeBreakService) { _coffeeRepository = coffeeRepository; _userRepository = userRepository; _slack = messageSender; _adminValidator = adminValidator; _coffeeBreakService = coffeeBreakService; }
private void SetUp() { _appSettingsMock = new Mock <IApplicationSettingsService>(); _paymentServiceMock = new Mock <IPaymentService>(); _condimentServiceFactoryMock = new Mock <ICondimentServiceFactory>(); _service = new CoffeeService(_condimentServiceFactoryMock.Object, _paymentServiceMock.Object, _appSettingsMock.Object); }
public CoffeeController(ICoffeeService coffeeService, IOptionsSnapshot <ApiSettings> apiSettings, ILogger <CoffeeController> logger) { _coffeeService = coffeeService; _cofeelogger = logger; _apiSettings = apiSettings.Value; CheckArguments(); }
private void InitializeFunctionConfiguration() { var serviceCollection = new ServiceCollection(); serviceCollection.AddTransient <ICoffeeService, CoffeeService>(); var serviceProvider = serviceCollection.BuildServiceProvider(); _coffeeService = serviceProvider.GetService <ICoffeeService>(); }
public CoffeeDetailViewModel(ICoffeeService coffeeService) { _coffeeService = coffeeService; GetDetail = ReactiveCommand.CreateFromObservable <Guid, Unit>(ExecuteGetDetail); this.WhenAnyValue(x => x.CoffeeId) .Where(x => x != null) .InvokeCommand(this, x => x.GetDetail); }
public CoffeeDetailViewModel(ICoffeeService coffeeService) { NavigatingTo .Where(x => x.ContainsKey("Id")) .Select(x => x["Id"]) .Cast <Guid>() .SelectMany(coffeeService.Read) .Where(x => x != null) .ToProperty(this, x => x.Detail, out _detail) .DisposeWith(Garbage); }
public void CoffeeService_GetCoffee_MustReturnTheCupWithTheIngredientsOfCoffeePowderAndHotWater() { // Initialize DI ICoffeeService coffeeService = _kernel.Get <CoffeeService>(); // Act Cup cup = coffeeService.GetCoffee(); // Assert Assert.That(cup.ingredients.Contains("Coffee Powder")); Assert.That(cup.ingredients.Contains("Hot Water")); }
public MyCoffeeViewModel() { Title = "My Coffee"; Coffee = new ObservableRangeCollection <Coffee>(); RefreshCommand = new AsyncCommand(Refresh); AddCommand = new AsyncCommand(Add); RemoveCommand = new AsyncCommand <Coffee>(Remove); SelectedCommand = new AsyncCommand <Coffee>(Selected); coffeeService = DependencyService.Get <ICoffeeService>(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>(); Task.Run(async() => { await _coffeeService.InitializeAsync(); this.RunOnUiThread(() => { this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService); }); }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>(); Task.Run (async () => { await _coffeeService.InitializeAsync(); this.RunOnUiThread(() => { this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService); }); }); }
public MainViewModel(ICoffeMachineDataSender dataSender, ICoffeeService coffeeService, ICoffeeDataService coffeeDataService) { _dataSender = dataSender; this.coffeeService = coffeeService; this.coffeeDataService = coffeeDataService; SerialNumber = Guid.NewGuid().ToString().Substring(0, 8); MakeCappuccinoCommand = new DelegateCommand(MakeCappucinno); MakeEspressoCommand = new DelegateCommand(MakeEspresso); Logs = new ObservableCollection <string>(); _dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) }; _dispatcherTimer.Tick += DispatcherTimer_Tick; }
public DrinkCollectionViewModel() { _viewStackService = Locator.Current.GetService <IPopupViewStackService>(); _coffeeService = Locator.Current.GetService <ICoffeeService>(); CoffeeDetails = ReactiveCommand.CreateFromObservable <DrinkViewModel, Unit>(ExecuteNavigate).DisposeWith(Garbage); _coffeeService .ChangeSet .SubscribeOn(RxApp.TaskpoolScheduler) .Transform(x => new DrinkViewModel(x.Id, x.Name, x.Species, x.Regions, x.Image)) // .Sort(SortExpressionComparer<DrinkViewModel>.Ascending(p => p.Name)) .ObserveOn(RxApp.MainThreadScheduler) .Bind(out _coffeeList) .DisposeMany() .Subscribe() .DisposeWith(Garbage); }
public CoffeeListViewModel(IPopupViewStackService parameterViewStackService, ICoffeeService coffeeService) { _viewStackService = parameterViewStackService; _coffeeService = coffeeService; CoffeeDetails = ReactiveCommand.CreateFromObservable <CoffeeCellViewModel, Unit>(ExecuteNavigate); Refresh = ReactiveCommand.CreateFromTask(ExecuteRefresh); _coffeeService .ChangeSet .Transform(x => new CoffeeCellViewModel(x.Id, x.Name, x.Species, x.Regions, x.Image)) .Sort(SortExpressionComparer <CoffeeCellViewModel> .Ascending(p => p.Name)) .Bind(out _coffeeList) .DisposeMany() .Subscribe() .DisposeWith(Garbage); CoffeeDetails = ReactiveCommand.CreateFromObservable <CoffeeCellViewModel, Unit>(ExecuteNavigate).DisposeWith(Garbage); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CoffeeListFragment, null); var listView = view.FindViewById <ListView>(Resource.Id.coffee_listview); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>(); Task.Run(async() => { await _coffeeService.InitializeAsync(); Activity.RunOnUiThread(() => { listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService); }); }); listView.ItemClick += ListView_ItemClick; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CoffeeListFragment, null); var listView = view.FindViewById<ListView>(Resource.Id.coffee_listview); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>(); Task.Run(async () => { await _coffeeService.InitializeAsync(); Activity.RunOnUiThread(() => { listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService); }); }); listView.ItemClick += ListView_ItemClick; return view; }
public EventService(ICoffeeService coffeeBreakService, ISlursCommands slurs) { _coffeeBreakService = coffeeBreakService; _slurs = slurs; }
public CoffeesController(ICoffeeService _CoffeeService) { this._CoffeeService = _CoffeeService; }
public CoffeeListPageViewModel(ICoffeeService coffeeService) { _coffeeService = coffeeService; }
public CoffeeListPage() { InitializeComponent(); _service = ServiceLocator.Current.GetInstance <ICoffeeService> (); }
public CoffeeController(ICoffeeService coffeeService) { this.coffeeService = coffeeService; }
public CoffeeController(ICoffeeService coffeService) { _coffeService = coffeService; }
public CoffeeListViewModel(ICoffeeService coffeeService, INavigationService navigationService) { _navigationService = navigationService; _coffeeService = coffeeService; SelectRecord = new RelayCommand <Record> (ExecuteSelectRecord); }
public CoffeeTableViewController (IntPtr handle) : base (handle) { _coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>(); }
public CoffeeTableViewController(IntPtr handle) : base(handle) { _coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>(); }
public RecipeController(ApplicationDbContext context) { this._context = context; this._service = new CoffeeService(context); }
public EspressoMachineService(ICoffeeService coffeeService) { this.coffeeService = coffeeService; }
public ProfileViewVm() { _coffeeService = new CoffeeService(); }
public CoffeeListViewModel(ICoffeeService coffeeService, IAlertService alertService) { this.CoffeeService = coffeeService; this.alertService = alertService; LoadCoffeesCommand = new RelayCommand(() => InitializeData()); }
public CreamCoffeeService(ICoffeeService coffeeService) { _coffeeService = coffeeService; }
public CoffeeController(ICoffeeService coffeeService, ILog logger) { _coffeeService = coffeeService; _logger = logger; }
public CoffeeListAdapter(Activity context, ICoffeeService coffeeService) { this.coffeeService = coffeeService; _context = context; }
public HistoryChartDataController(ApplicationDbContext context) { this._context = context; this._service = new CoffeeService(context); }
public CoffeeTableSource(CoffeeTableViewController controller, ICoffeeService coffeeService) { _controller = controller; _coffeeService = coffeeService; }