예제 #1
0
 public UIMediator(ICommandInvoker commandInvoker, IDogRacePalaceStadium dogRacePalaceStadium, IRacetrack racetrack, IBettingBank bettingBank)
 {
     _commandInvoker       = commandInvoker;
     _dogRacePalaceStadium = dogRacePalaceStadium;
     _racetrack            = racetrack;
     _bettingBank          = bettingBank;
 }
예제 #2
0
 public BotImpl(ApiClient api, ICommandInvoker invoker, IUpdatesProvider updatesProvider, IReplySender replySender)
 {
     _api             = api;
     _invoker         = invoker;
     _updatesProvider = updatesProvider;
     _replySender     = replySender;
 }
예제 #3
0
    private void AddEditRow(List <CommandBindingRow> rows, ICommandInvoker commandInvoker)
    {
        var go = new GameObject();

        go.transform.SetParent(transform, false);

        var row = new CommandBindingRow {
            container = go, invoker = commandInvoker
        };

        rows.Add(row);

        go.transform.SetSiblingIndex(transform.childCount - 1);

        var group = go.AddComponent <HorizontalLayoutGroup>();

        group.spacing = 10f;

        var isAnalog = commandInvoker is IAnalogCommandInvoker;

        var displayNameText = prefabManager.CreateText(go.transform, commandInvoker.localName + (isAnalog ? " *" : ""));

        if (isAnalog)
        {
            displayNameText.color = new Color(0, 0.3f, 0.4f);
        }
        var displayNameLayout = displayNameText.GetComponent <LayoutElement>();

        displayNameLayout.flexibleWidth = 1000f;

        row.bindingBtn1 = CreateBindingButton(commandInvoker, go, 0);
        row.bindingBtn2 = CreateBindingButton(commandInvoker, go, 1);
    }
        public ContactEditorViewModel(ICommandInvoker commandInvoker, IQueryInvoker queryInvoker)
        {
            this.queryInvoker = queryInvoker;
            Contacts = queryInvoker.Query<AllContactsQueryResult>().Contacts;

            SaveCommand = new DelegateCommand(() =>
                {
                    if (CurrentContact.Command is UpdateContactCommand)
                    {
                        commandInvoker.Execute<UpdateContactCommand, UpdateContactQueryResult>((UpdateContactCommand) CurrentContact.Command);
                    }
                    else
                    {
                        commandInvoker.Execute<CreateContactCommand, CreateContactQueryResult>(CurrentContact.Command);
                    }

                    Contacts = queryInvoker.Query<AllContactsQueryResult>().Contacts;
                });

            NewCommand = new DelegateCommand(() =>
                {
                    var modifyContactQueryResult = queryInvoker.Query<CreateContactQueryResult>();
                    CurrentContact = new CreateContactViewModel(modifyContactQueryResult, new ValidationService());
                });
            NewCommand.Execute(null);
        }
예제 #5
0
 public ExpenseController(ICommandInvoker invoker, ICategoryService categoryService, IUserService userService, IExpenseService expenseService)
 {
     this.invoker = invoker;
     this.categoryService = categoryService;
     this.userService = userService;
     this.expenseService = expenseService;
 }
예제 #6
0
        static void Main(string[] args)
        {
            var serviceProvider = new ServiceCollection()
                                  .AddLogging(config => config.AddConsole().SetMinimumLevel(LogLevel.Debug))
                                  .AddTaCqrs()
                                  .AddCommandHandler <AddCustomerCommandHandler, AddCustomerCommand>()
                                  .AddScoped <IContextDataProvider, ContextDataProvider>()
                                  .BuildServiceProvider();

            Stopwatch       stopwatch      = Stopwatch.StartNew();
            ILoggerFactory  loggerFactory  = serviceProvider.GetService <ILoggerFactory>();
            ILogger         logger         = loggerFactory.CreateLogger <Program>();
            ICommandInvoker commandInvoker = serviceProvider.GetService <ICommandInvoker>();

            for (int i = 0; i < 10; i++)
            {
                ExecutionResponse executionResponse = commandInvoker.Invoke(new AddCustomerCommand()
                {
                    Name = "Customer 1"
                }).Result;
                logger.LogDebug($"{executionResponse.AdditionalData.GetCreatedAt()}");
            }

            stopwatch.Stop();
            logger.LogDebug($"{stopwatch.Elapsed}");
            logger.LogDebug("Completed!, Press any key to exit");
            Console.WriteLine($"{stopwatch.Elapsed}");
            Console.ReadKey();
        }
예제 #7
0
    private UIDynamicButton CreateBindingButton(ICommandInvoker commandInvoker, GameObject go, int slot)
    {
        var bindingBtn = prefabManager.CreateButton(go.transform, GetMappedBinding(commandInvoker, slot));

        bindingBtn.button.onClick.AddListener(() =>
        {
            if (isRecording)
            {
                return;
            }
            if (commandInvoker is IActionCommandInvoker)
            {
                _setKeybindingCoroutine = StartCoroutine(RecordKeys(bindingBtn, commandInvoker, bindingBtn.buttonColor, slot));
                bindingBtn.label        = "Type your shortcut...";
            }
            else if (commandInvoker is IAnalogCommandInvoker)
            {
                _setKeybindingCoroutine = StartCoroutine(RecordAnalog(bindingBtn, commandInvoker, bindingBtn.buttonColor, slot));
                bindingBtn.label        = "Axis or 2 keys...";
            }
            bindingBtn.buttonColor = new Color(0.9f, 0.6f, 0.65f);
        });
        var bindingLayout = bindingBtn.GetComponent <LayoutElement>();

        bindingLayout.minWidth       = 300f;
        bindingLayout.preferredWidth = 300f;
        return(bindingBtn);
    }
예제 #8
0
        public RemoveSelected(ObservableCollection <AddedPath> addedPaths, ObservableCollection <AddedPath> selectedPaths, ICommandInvoker commandInvoker)
        {
            this.addedPaths     = addedPaths;
            this.selectedPaths  = selectedPaths;
            this.commandInvoker = commandInvoker;

            this.selectedPaths.CollectionChanged += (s, e) => CanExecuteChanged.Raise(this, EventArgs.Empty);
        }
예제 #9
0
 public WorkoutController(IWorkoutService workoutService, ICommandInvoker commandInvoker, IViewFactory <int, WorkoutSummaryViewModel> viewFactory, IViewFactory <string, IList <Workout> > workoutViewFactory, UserIdProvider idProvider)
 {
     _workoutService     = workoutService;
     _commandInvoker     = commandInvoker;
     _viewFactory        = viewFactory;
     _workoutViewFactory = workoutViewFactory;
     _idProvider         = idProvider;
 }
예제 #10
0
 public CommandInitializer(IPlateau _plateau, IRoverManager _roverManager, ICommandParser aCommandParser, ICommandInvoker aCommandInvoker)
 {
     plateau        = _plateau;
     commandParser  = aCommandParser;
     commandInvoker = aCommandInvoker;
     commandInvoker.SetPlateau(plateau);
     commandInvoker.SetRoverManager(_roverManager);
 }
예제 #11
0
 public ConsoleDrawEngine(
     ICanvasRenderer <ConsolePixelData> canvasRenderer,
     ICommandInvoker <ConsolePixelData, ConsoleInputContext> commandInvoker,
     IReceiver <ConsoleInputContext> receiver,
     ILogger logger)
     : base(canvasRenderer, commandInvoker, receiver, logger)
 {
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HangmanGame"/> class.
 /// Provides methods for running the game, ending the game and executing commands.
 /// </summary>
 public HangmanGame()
 {
     this.printer = new ConsolePrinter();
     this.context = new GameContext(SimpleRandomWordProvider.Instance, new Scoreboard(new ConsolePrinter(), new SelectionSorter(), new TextFileScoreboardDataManager<Dictionary<string, int>>()));
     this.commandFactory = new CommandFactory();
     this.gameSaver = new SaveLoadManager(this.printer, new XmlGameStateManager<SaveLoadManager>());
     this.commandExecutioner = new HangmanCommandInvoker();
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandPop3Client" /> class.
 /// </summary>
 /// <param name="commandInvoker">The command invoker.</param>
 /// <exception cref="System.ArgumentNullException"></exception>
 public CommandPop3Client(ICommandInvoker commandInvoker)
 {
     if (commandInvoker == null)
     {
         throw new ArgumentNullException(nameof(commandInvoker));
     }
     CommandInvoker = commandInvoker;
 }
예제 #14
0
 public WorkoutController(IWorkoutService workoutService, ICommandInvoker commandInvoker, IViewFactory<int, WorkoutSummaryViewModel> viewFactory, IViewFactory<string, IList<Workout>> workoutViewFactory, UserIdProvider idProvider)
 {
     _workoutService = workoutService;
     _commandInvoker = commandInvoker;
     _viewFactory = viewFactory;
     _workoutViewFactory = workoutViewFactory;
     _idProvider = idProvider;
 }
예제 #15
0
 public MessageProcessor(IMessageMapper mappingEngine, ICommandInvoker commandInvoker, IUnitOfWork unitOfWork,
     CommandEngineConfiguration configuration
     )
 {
     _mappingEngine = mappingEngine;
     _commandInvoker = commandInvoker;
     _unitOfWork = unitOfWork;
     _configuration = configuration;
 }
        internal void Init(ICommandInvoker solutionInvoker, ICommandInvoker addinInvoker) {
            LogManager.Create(Context.Output);
            LogManager.WriteMessage("Initializing commands.");
            solutionInvoker.AddCommand(new OpenSolutionCommand(this));
            solutionInvoker.AddCommand(new CloseSolutionCommand(this));

            addinInvoker.AddCommand(new AddinStartupCommand(this));
            addinInvoker.AddCommand(new AddinDisconnectCommand(this));
        }
예제 #17
0
 public MessageProcessor(IMessageMapper mappingEngine, ICommandInvoker commandInvoker, IUnitOfWork unitOfWork,
                         CommandEngineConfiguration configuration
                         )
 {
     _mappingEngine  = mappingEngine;
     _commandInvoker = commandInvoker;
     _unitOfWork     = unitOfWork;
     _configuration  = configuration;
 }
        public DeletePersonConfirmationViewModel(Person personToBeDeleted, ObservableCollection <Person> peopleList, IPersonServices personProxy, ICommandInvoker commandInvoker)
        {
            PersonToBeDeleted = personToBeDeleted;
            PeopleList        = peopleList;

            DeletePersonCommand = new RelayCommand(DeletePersonConfirmationExecute, DeletePersonConfirmationCanExecute);

            PersonProxy    = personProxy;
            CommandInvoker = commandInvoker;
        }
        internal void Init(ICommandInvoker solutionInvoker, ICommandInvoker addinInvoker)
        {
            LogManager.Create(Context.Output);
            LogManager.WriteMessage("Initializing commands.");
            solutionInvoker.AddCommand(new OpenSolutionCommand(this));
            solutionInvoker.AddCommand(new CloseSolutionCommand(this));

            addinInvoker.AddCommand(new AddinStartupCommand(this));
            addinInvoker.AddCommand(new AddinDisconnectCommand(this));
        }
예제 #20
0
    private void implConstructor(ReceiverMode receiverMode, ICommandInvoker commandInvoker,
                                 ICommandListenerLinked <CommandReceiver> commandListener)
    {
        this.m_ReceiverMode = receiverMode;

        this.m_CommandInvoker  = commandInvoker ?? new CommandInvokerDefault();
        this.m_CommandListener = commandListener ?? new CommandListenerDefault <CommandReceiver>();

        this.m_CommandListener.iAttach(this);
    }
예제 #21
0
 public CommandManager(IPlateu plateu, ICommandMapper commandMapper, ICommandInvoker commandInvoker, IOutputGenerator outputGenerator)
 {
     rovers               = new List <IRover>();
     this.plateu          = plateu;
     this.commandMapper   = commandMapper;
     this.commandInvoker  = commandInvoker;
     this.outputGenerator = outputGenerator;
     this.commandInvoker.SetPlateu(this.plateu);
     this.commandInvoker.SetRovers(rovers);
 }
예제 #22
0
 public CommandCenter(ILandingSurface aLandingSurface, ICommandParser aCommandParser, ICommandInvoker aCommandInvoker, IReportComposer aReportComposer)
 {
     rovers = new List<IRover>();
     landingSurface = aLandingSurface;
     commandParser = aCommandParser;
     commandInvoker = aCommandInvoker;
     reportComposer = aReportComposer;
     commandInvoker.SetLandingSurface(landingSurface);
     commandInvoker.SetRovers(rovers);
 }
예제 #23
0
        public BotImpl(ApiClient api, UpdateProvider updateProvider, ICommandInvoker invoker, IReplySender replySender)
        {
            _api            = api;
            _updateProvider = updateProvider;
            _invoker        = invoker;
            _replySender    = replySender;

            //это должно инжектиться
            _logger = new ConsoleLogger();
        }
예제 #24
0
 public CommandMain(ISurface aLandingSurface, ICommandParser aCommandParser, ICommandInvoker aCommandInvoker, IReportComposer aReportComposer)
 {
     rovers         = new List <IRover>();
     landingSurface = aLandingSurface;
     commandParser  = aCommandParser;
     commandInvoker = aCommandInvoker;
     reportComposer = aReportComposer;
     commandInvoker.SetLandingSurface(landingSurface);
     commandInvoker.SetRovers(rovers);
 }
        public AddPersonViewModel(ObservableCollection <Person> peopleList, IPersonServices personProxy, ICommandInvoker commandInvoker)
        {
            AddPersonCommand = new RelayCommand(AddPersonExecute, AddPersonCanExecute);
            PeopleList       = peopleList;
            PersonProxy      = personProxy;
            CommandInvoker   = commandInvoker;

            logger.Debug("AddPersonViewModel constructor successful call.");
            LoggerHelper.Instance.LogMessage("AddPersonViewModel constructor successful call.", EEventPriority.DEBUG, EStringBuilder.CLIENT);
        }
예제 #26
0
 public CommandCenter(ISurface _surface, ICommandParser _commandparser, ICommandInvoker _commandInvoker, IReportComposer _reportComposer)
 {
     pirate         = new List <IPirate>();
     surface        = _surface;
     commandParser  = _commandparser;
     commandInvoker = _commandInvoker;
     reportComposer = _reportComposer;
     commandInvoker.SetSurface(surface);
     commandInvoker.SetPirate(pirate);
 }
예제 #27
0
 public DrawEngine(
     ICanvasRenderer <TPixelData> canvasRenderer,
     ICommandInvoker <TPixelData, TCommandInput> commandInvoker,
     IReceiver <TCommandInput> receiver,
     ILogger logger)
 {
     _canvasRenderer = canvasRenderer;
     _commandInvoker = commandInvoker;
     _receiver       = receiver;
     _logger         = logger;
 }
예제 #28
0
 private void StopRecording(UIDynamicButton btn, Color btnColor, ICommandInvoker commandInvoker, int slot)
 {
     isRecording     = false;
     btn.buttonColor = btnColor;
     btn.label       = GetMappedBinding(commandInvoker, slot);
     if (_setKeybindingCoroutine != null)
     {
         StopCoroutine(_setKeybindingCoroutine);
     }
     _setKeybindingCoroutine = null;
 }
예제 #29
0
        public CommandFactory(IPlateau plateau, ICommandParser commandParser, ICommandInvoker commandInvoker, IReportComposer reportComposer)
        {
            _rovers         = new List <IRover>();
            _plateau        = plateau;
            _commandParser  = commandParser;
            _commandInvoker = commandInvoker;
            _reportComposer = reportComposer;

            _commandInvoker.SetPlateau(_plateau);
            _commandInvoker.SetRovers(_rovers);
        }
예제 #30
0
        public void Setup()
        {
            arguments = new StringBuilder();
            arguments.AppendLine("5 5");
            arguments.AppendLine("1 1 N");
            arguments.AppendLine("LMLMLM");
            arguments.AppendLine("2 2 S");
            arguments.AppendLine("RMLMR");

            roverCommandParser = Substitute.For <IRoverCommandParser>();
            commandInvoker     = Substitute.For <ICommandInvoker>();
        }
예제 #31
0
 public TelegramBot(HttpClient client,
                    IDistributedCache cache,
                    ICommandResolver commandResolver,
                    ICommandInvoker commandInvoker,
                    ILogger <TelegramBot> logger)
 {
     _client          = client;
     _cache           = cache;
     _commandResolver = commandResolver;
     _commandInvoker  = commandInvoker;
     _logger          = logger;
 }
예제 #32
0
 public PostManagerController(ILogger <PostManagerController> logger,
                              ICommandInvoker <PostIndexCommand, List <PostManagerListViewModel> > postManagerIndexCommandInvorker,
                              ICommandInvoker <AddPostCommand, CommonResult> addPostCommandInvorker,
                              ICommandInvoker <GetPostInfoCommand, PostInfoVIewModel> getPostInfoCommandInvorker,
                              ICommandInvoker <UpdatePostCommand, CommonResult> updatePostCommandInvorker)
 {
     this._postManagerIndexCommandInvorker = postManagerIndexCommandInvorker;
     this._logger = logger;
     this._addPostCommandInvorker     = addPostCommandInvorker;
     this._getPostInfoCommandInvorker = getPostInfoCommandInvorker;
     this._updatePostCommandInvorker  = updatePostCommandInvorker;
 }
예제 #33
0
        public WebhookService(ICommandResolver commandResolver,
                              ITelegramBot telegramBot,
                              ICommandInvoker commandInvoker,
                              ILogger <WebhookService> logger)
        {
            _commandResolver = commandResolver;
            _telegramBot     = telegramBot;
            _commandInvoker  = commandInvoker;
            _logger          = logger;

            _mapper = new Mapper(new MapperConfiguration(x => x.AddProfile <RequestProfile>()));
        }
예제 #34
0
        public Mission(ILandingSurface landingSurface, ICommandParser commandParser, ICommandInvoker commandInvoker, IReportBuilder reportBuilder)
        {
            _rovers = new List <IRover>();

            _commandParser  = commandParser;
            _commandInvoker = commandInvoker;

            _commandInvoker.SetLandingSurface(landingSurface);
            _commandInvoker.SetRovers(_rovers);

            _reportBuilder = reportBuilder;
        }
예제 #35
0
        public CommandCenter(ICommandParser _commandParser, ICommandInvoker _commandInvoker)
        {
            robots         = new List <IRobot>();
            Mars           = new Mars();
            reportComposer = new OutputParser();


            commandParser  = _commandParser;
            commandInvoker = _commandInvoker;
            commandInvoker.SetDimensionMars(Mars);
            commandInvoker.SetRobots(robots);
        }
예제 #36
0
        private static void CalculatePrice(string commandName, string[] arguments, ICommandInvoker commandInvoker)
        {
            IBasketService           basketService           = new BasketService(dbContext);
            GetProductsByNameCommand getProductByNameCommand = new GetProductsByNameCommand(basketService);

            getProductByNameCommand.ProductNames = arguments;
            commandInvoker.ExecuteCommand(getProductByNameCommand);
            IEnumerable <BasketItem> products = getProductByNameCommand.Result;

            if (products.Count() == 0)
            {
                Console.WriteLine("Given products are not available!");
                return;
            }

            CalculateTotalPriceCommand calculateTotalPriceCommand = AppCommandsByName[commandName] as CalculateTotalPriceCommand;

            calculateTotalPriceCommand.Items = products;
            commandInvoker.ExecuteCommand(calculateTotalPriceCommand);

            decimal basketItemsTotalPrice = calculateTotalPriceCommand.Result;

            Console.WriteLine($"Subtotal: {basketItemsTotalPrice:c}");

            IDateTimeUtil dateTimeUtil = new DateTimeUtil();
            ITimespanDiscountCalculator timespanDiscountCalculator = new TimespanDiscountCalculator(dateTimeUtil);
            IQuantityDiscountCalculator quantityDiscountCalculator = new QuantityDiscountCalculator();
            IDiscountService            discountService            = new DiscountService(dbContext, timespanDiscountCalculator, quantityDiscountCalculator);
            GetDiscountsCommand         getDiscountCommand         = new GetDiscountsCommand(discountService);

            getDiscountCommand.Items = products;
            commandInvoker.ExecuteCommand(getDiscountCommand);

            IEnumerable <DiscountResult> discounts = getDiscountCommand.Result;

            if (discounts.Count() > 0)
            {
                foreach (DiscountResult discount in discounts)
                {
                    Console.WriteLine($"{discount.ProductPluralName} {discount.DiscountPercentage:p0} off: -{discount.DiscountedPrice:c}");
                }
            }
            else
            {
                Console.WriteLine("(No offers available)");
            }

            decimal discountPrice = discounts.Sum(s => s.DiscountedPrice);
            decimal totalPrice    = basketItemsTotalPrice - discountPrice;

            Console.WriteLine($"Total price: {totalPrice:c}");
        }
예제 #37
0
 public AdminController(ICommandInvoker <LoginCommand, CommonResult> command,
                        IVerificationCodeTool verificationCodeTool, IAntiforgery antiforgery,
                        ICommandInvoker <AdminUserInitCommand, CommonResult> adminUserInitCommand,
                        ICommandInvoker <IndexInfoCommand, CommonResult <IndexInfoViewModel> > indexInfoCommand,
                        IOptions <AdminUserConfig> admin)
 {
     this._command = command;
     this._verificationCodeTool = verificationCodeTool;
     this._antiforgery          = antiforgery;
     this._adminUserInitCommand = adminUserInitCommand;
     this.adminUserConfig       = admin.Value;
     this._indexInfoCommand     = indexInfoCommand;
 }
예제 #38
0
        public ContactController()
        {
            // You'd really DI this is from autofac.
            var contactService = new ContactService(new CountyRepository(),
                                                      new CountryRepository(),
                                                      new ContactRepository(),
                                                      new ValidationService(),
                                                      new ContactAdministrationService(new CountyRepository(),
                                                                                       new CountryRepository(),
                                                                                       new ContactRepository()));

            commandInvoker = new CommandInvoker(contactService);
            queryInvoker = new QueryInvoker(contactService);
        }
예제 #39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HangmanGame"/> class.
 /// Provides methods for running the game, ending the game and executing commands.
 /// </summary>
 /// <param name="printer">The object used to show messages.</param>
 /// <param name="sorter">The object used to sort scores.</param>
 /// <param name="scoresDataManager">The object from which scores are read and written in.</param>
 /// <param name="gameStateManager">The object used to save the current game state.</param>
 /// <param name="commandFactory">The object used to deal with commands needed.</param>
 /// <param name="commandExecutioner">The object used for the execution of commands.</param>
 /// <param name="wordProvider">The object that provides the word for the current game.</param>
 public HangmanGame(
     IPrinter printer,
     ISorter sorter,
     IDataManager<Dictionary<string, int>> scoresDataManager,
     IDataManager<SaveLoadManager> gameStateManager,
     CommandFactory commandFactory,
     ICommandInvoker commandExecutioner,
     IWordProvider wordProvider)
 {
     this.printer = printer;
     this.context = new GameContext(wordProvider, new Scoreboard(printer, sorter, scoresDataManager));
     this.commandFactory = new CommandFactory();
     this.gameSaver = new SaveLoadManager(this.printer, gameStateManager);
     this.commandExecutioner = new HangmanCommandInvoker();
 }
예제 #40
0
 public WorkoutController(IWorkoutService service, ICommandInvoker commandInvoker)
 {
     _service = service;
     _commandInvoker = commandInvoker;
 }
예제 #41
0
 public WorkoutService(IRepository<Workout> repository, ISessionStorage sessionStorage, ICommandInvoker commandInvoker)
 {
     _repository = repository;
     _sessionStorage = sessionStorage;
     _commandInvoker = commandInvoker;
 }
예제 #42
0
 public CardioController(IViewModelFactory<object, AddCardioReviewDisplayModel> viewModelFactory, ICommandInvoker commandInvoker)
 {
     _viewModelFactory = viewModelFactory;
     _commandInvoker = commandInvoker;
 }
예제 #43
0
 public WorkoutController(IWorkoutService workoutService, ICommandInvoker commandInvoker, IViewFactory<int, WorkoutSummaryViewModel> viewFactory)
 {
     _workoutService = workoutService;
     _commandInvoker = commandInvoker;
     _viewFactory = viewFactory;
 }
예제 #44
0
 /// <summary>
 /// Constructs a <see cref="DefaultCommandModuleResolver"/>
 /// </summary>
 /// <param name="catalog"></param>
 /// <param name="commandInvoker"></param>
 public DefaultCommandResolver(ICommandCatalog catalog, ICommandInvoker commandInvoker)
 {
     Catalog = catalog;
     CommandInvoker = commandInvoker;
 }
예제 #45
0
 public NotesController(ICommandInvoker commandInvoker, INoteRepository noteRepository, IUserRepository userRepository)
 {
     this.commandInvoker = commandInvoker;
     this.userRepository = userRepository;
     this.noteRepository = noteRepository;
 }
예제 #46
0
 public BaseController(IDatabase database, ICommandInvoker invoker)
 {
     DataContext = database;
     Command = invoker;
 }
예제 #47
0
 public ImageController(ICommandInvoker commandInvoker, IViewRepository viewRepository)
 {
     this.commandInvoker = commandInvoker;
     this.viewRepository = viewRepository;
 }
예제 #48
0
 public AddController(ICommandInvoker commandInvoker, IViewFactory<ExerciseType, IList<Exercise>> viewFactory)
 {
     _commandInvoker = commandInvoker;
     _viewFactory = viewFactory;
 }
예제 #49
0
 public CategoryController(ICommandInvoker invoker, ICategoryService categoryService, IUserService userService)
 {
     this.invoker = invoker;
     this.categoryService = categoryService;
     this.userService = userService;
 }
예제 #50
0
 public AccountController(IRepository<User> repository, ICommandInvoker commandInvoker)
 {
     _repository = repository;
     _commandInvoker = commandInvoker;
 }
        public When_the_submissions_service_is_asked_to_send_an_LRAP1_package()
        {
            _applicationId = "01234567890";
            _username = "******";
            _password = "******";

            _fakeCommandInvoker = A.Fake<ICommandInvoker>();

            var attachments = new List<Lrap1Attachment>
            {
                new Lrap1Attachment() {Payload = "Attachment 1 payload data"},
                new Lrap1Attachment() {Payload = "Attachment 2 payload data"}
            };

            _package = new Lrap1Package()
            {
                Payload = "Lrap1 Payload Data",
                Attachments = attachments
            };

            A.CallTo(
                () =>
                    _fakeCommandInvoker.Execute<CreateLrap1SubmissionCommand, CreateLrap1SubmissionQueryResult>(
                        A<CreateLrap1SubmissionCommand>.Ignored)).Returns(new CreateLrap1SubmissionQueryResult()
                        {
                            Command = new CreateLrap1SubmissionCommand()
                                {
                                    ApplicationId = _applicationId,
                                    Username = _username,
                                    Payload = _package.Payload
                                }
                        });

            A.CallTo(
                () =>
                    _fakeCommandInvoker.Execute<CreateLrap1AttachmentCommand, CreateLrap1AttachmentQueryResult>(
                        A<CreateLrap1AttachmentCommand>.Ignored)).Returns(new CreateLrap1AttachmentQueryResult()
                        {
                            Command = new CreateLrap1AttachmentCommand()
                            {
                                AttachmentId = "98765",
                                ApplicationId = _applicationId,
                                Username = _username,
                                Payload = _package.Payload
                            }
                        });

            _fakeMessageSender = A.Fake<ISendMessages>();

            A.CallTo(() => _fakeMessageSender.Send(A<SubmitLrap1Command>.That.Matches(
                c => c.Username == _username &&
                     c.Password == _password &&
                     c.Payload == _package.Payload)))
                .Returns(new SubmitLrap1Result()
                    {
                        Command = new SubmitLrap1Command()
                        {
                            ApplicationId = _applicationId,
                            Username = _username,
                            Password = _password,
                            Payload = _package.Payload
                        }
                    });

            var sut = new Lrap1SubmissionService(_fakeMessageSender, _fakeCommandInvoker);
            _response = sut.Submit(_username, _password, _package);
        }
예제 #52
0
                public void Setup()
                {
                    _repository = Substitute.For<IRepository<Workout>>();
                    _invoker = Substitute.For<ICommandInvoker>();
                    _storage = Substitute.For<ISessionStorage>();

                    _service = new WorkoutService(_repository, _storage, _invoker);
                }
예제 #53
0
 public WorkoutService(IWorkoutRepository repository, ICommandInvoker commandInvoker)
 {
     _repository = repository;
     _commandInvoker = commandInvoker;
 }
예제 #54
0
 public ExercisesController(ICommandInvoker invoker, IViewRepository viewRepository)
 {
     _invoker = invoker;
     _viewRepository = viewRepository;
 }
예제 #55
0
 public AbsenceController(ICommandInvoker invoker, IUserService userService)
 {
     this.invoker = invoker;
     this.userService = userService;
 }
 public TransactionController(ICommandInvoker invoker,ITransactionService transactionService, IUserService userService)
 {
     this.invoker = invoker;
     this.transactionService = transactionService;
     this.userService = userService;
 }
예제 #57
0
 public StrengthController(IViewModelFactory<StrengthInputQuery, StrengthViewModel> factory, ICommandInvoker invoker)
 {
     _factory = factory;
     _invoker = invoker;
 }
 public Lrap1SubmissionService(ISendMessages messageSender, ICommandInvoker commandInvoker )
 {
     _messageSender = messageSender;
     _commandInvoker = commandInvoker;
 }
 public PresentationController(ICommandInvoker commandInvoker, IViewRepository viewRepository)
 {
     this.commandInvoker = commandInvoker;
     this.viewRepository = viewRepository;
 }
 public PostController(ICommandInvoker commandInvoker, IPostReadQueries postReadQueries)
 {
     _commandInvoker = commandInvoker;
     _postReadQueries = postReadQueries;
 }