public StatementControllerNavigation(
            [NotNull] IMessenger messenger, 
            [NotNull] StatementController controller, 
            [NotNull] IUserQuestionBoxYesNo questionBox)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }
            
            if (questionBox == null)
            {
                throw new ArgumentNullException("questionBox");
            }

            MessengerInstance = messenger;
            this.controller = controller;
            this.questionBox = questionBox;

            MessengerInstance.Register<NavigateToTransactionMessage>(this, OnNavigateToTransactionRequestReceived);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializers the specified controller.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="controller">The controller.</param>
 /// <param name="context">The context.</param>
 protected void Initializer <T>(StatementController <T> controller, InvokationContext context)
 {
     controller.Attachments = context.Attachments;
     controller.Context     = context.Context;
     controller.Scope       = (T)context.Scope;
     controller.Tracer      = context.Tracer;
 }
        public TransactionGroupedByBucketViewModel(
            [NotNull] IEnumerable<Transaction> transactions,
            [NotNull] BudgetBucket groupByThisBucket,
            [NotNull] StatementController statementController)
            : base(transactions, groupByThisBucket)
        {
            if (statementController == null)
            {
                throw new ArgumentNullException("statementController");
            }

            this.statementController = statementController;
        }
        public AppliedRulesController([NotNull] UiContext uiContext, [NotNull] IMatchmaker matchmaker)
        {
            this.matchmaker = matchmaker;
            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

            if (matchmaker == null)
            {
                throw new ArgumentNullException("matchmaker");
            }

            RulesController = uiContext.RulesController;
            this.statementController = uiContext.StatementController;
            this.messageBox = uiContext.UserPrompts.MessageBox;
        }
        public async Task Get_ExistingAccountDifferentCustomerStatement_ShouldReturnNotFound()
        {
            var testAccountId  = 1;
            var testCustomerId = 1;

            _mockMediator
            .Setup(m => m.Send(It.Is <AccountGetRequest>(a => a.AccountId == testAccountId && a.CustomerId == testCustomerId), default))
            .ThrowsAsync(new NotFoundException())
            .Verifiable();

            var controller = new StatementController(Mapper, _mockMediator.Object);

            var result = await controller.Get(testAccountId, testCustomerId);

            _mockMediator.Verify();

            Assert.True(typeof(NotFoundObjectResult) == result.Result.GetType());
        }
        public async Task Get_Statements_ShouldReturnStatements()
        {
            var testAccountId  = 1;
            var testCustomerId = 1;

            var testAccount = GetTestAccount(testAccountId, testCustomerId);

            _mockMediator
            .Setup(m => m.Send(It.Is <AccountGetRequest>(a => a.AccountId == testAccountId && a.CustomerId == testCustomerId), default))
            .ReturnsAsync(testAccount)
            .Verifiable();


            var controller = new StatementController(Mapper, _mockMediator.Object);

            var result = await controller.Get(testAccountId, testCustomerId);

            _mockMediator.Verify();


            Assert.True(typeof(StatementModel) == result.Value.GetType());
            Assert.Equal(testAccount.Transactions.Count(), result.Value.Transactions.Count());
        }
        public AppliedRulesController([NotNull] IUiContext uiContext, [NotNull] ITransactionRuleService ruleService, [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (ruleService == null)
            {
                throw new ArgumentNullException(nameof(ruleService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            RulesController = uiContext.RulesController;
            this.ruleService = ruleService;
            this.applicationDatabaseService = applicationDatabaseService;
            this.statementController = uiContext.StatementController;
            this.messageBox = uiContext.UserPrompts.MessageBox;
            this.ruleService.Saved += OnSavedNotificationReceived;
        }
Exemplo n.º 8
0
        public AppliedRulesController([NotNull] IUiContext uiContext, [NotNull] ITransactionRuleService ruleService, [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (ruleService == null)
            {
                throw new ArgumentNullException(nameof(ruleService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            RulesController  = uiContext.RulesController;
            this.ruleService = ruleService;
            this.applicationDatabaseService = applicationDatabaseService;
            this.statementController        = uiContext.StatementController;
            this.messageBox         = uiContext.UserPrompts.MessageBox;
            this.ruleService.Saved += OnSavedNotificationReceived;
        }
Exemplo n.º 9
0
 public StatementViewModel Initialise(StatementController controller)
 {
     this.statementController = controller;
     return this;
 }
 internal void Initialise(Dispatcher currentDispatcher, StatementController controller)
 {
     this.dispatcher = currentDispatcher;
     ViewModel.Initialise(controller);
 }
Exemplo n.º 11
0
 public OverviewHub(StatementController statementController)
 {
     this.statementController = statementController;
 }
        public void TestInitialise()
        {
            MockBucketRepo = new Mock<IBudgetBucketRepository>();

            MockUiContext = new Mock<IUiContext>();
            // Todo Need message, yesnobox, waitcursorfactory, backgroundjob, appliedrulescontroller

            FakeStatetmentController = new StatementController(
                MockUiContext.Object,
                new StatementControllerFileOperations(
                    MockUiContext.Object,
                    new Mock<IStatementFileManager>().Object,
                    new Mock<IRecentFileManager>().Object,
                    new DemoFileHelper(),
                    MockBucketRepo.Object)
                );
        }