Inheritance: ViewModelBase
コード例 #1
0
        public StatementControllerFileOperations(
            [NotNull] IUiContext uiContext,
            [NotNull] IStatementFileManager statementFileManager,
            [NotNull] IRecentFileManager recentFileManager,
            [NotNull] DemoFileHelper demoFileHelper,
            [NotNull] IBudgetBucketRepository budgetBucketRepository)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

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

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

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

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

            this.uiContext = uiContext;
            this.statementFileManager = statementFileManager;
            this.recentFileManager = recentFileManager;
            this.demoFileHelper = demoFileHelper;
            this.recentFileCommands = new List<ICommand> { null, null, null, null, null };
            ViewModel = new StatementViewModel(budgetBucketRepository);
        }
コード例 #2
0
        public StatementControllerFileOperations(
            [NotNull] IUiContext uiContext,
            [NotNull] LoadFileController loadFileController,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

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

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

            this.messageBox = uiContext.UserPrompts.MessageBox;
            this.loadFileController = loadFileController;
            ViewModel = new StatementViewModel(uiContext, applicationDatabaseService);
        }
コード例 #3
0
        public StatementControllerFileOperations(
            [NotNull] IUiContext uiContext,
            [NotNull] LoadFileController loadFileController,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

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

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

            this.messageBox         = uiContext.UserPrompts.MessageBox;
            this.loadFileController = loadFileController;
            ViewModel = new StatementViewModel(uiContext, applicationDatabaseService);
        }
コード例 #4
0
 private static Transaction GetPhoneTxnFromGroupedList(StatementViewModel subject)
 {
     Transaction transactionFromGroupedList = subject.GroupedByBucket.Single(g => g.Bucket == StatementModelTestData.PhoneBucket)
         .Transactions.Single(t => t.Date == new DateTime(2013, 07, 16));
     return transactionFromGroupedList;
 }
コード例 #5
0
 private static Transaction GetPhoneTxnFromFullList(StatementViewModel subject)
 {
     Transaction transactionFromFullList = subject.Statement.Transactions
         .Single(t => t.BudgetBucket == StatementModelTestData.PhoneBucket && t.Date == new DateTime(2013, 07, 16));
     return transactionFromFullList;
 }
コード例 #6
0
 public void GivenNoDataStatementNameShouldBeNoTransactionsLoaded()
 {
     var subject = new StatementViewModel(MockBucketRepo.Object);
     Assert.AreEqual("[No Transactions Loaded]", subject.StatementName);
 }
コード例 #7
0
 public void GivenNoDataHasTransactionsShouldBeFalse()
 {
     var subject = new StatementViewModel(MockBucketRepo.Object);
     Assert.IsFalse(subject.HasTransactions);
 }