Ejemplo n.º 1
0
        private static  void UpdateTile()
        {
            var cashFlow =
                new CashFlowProvider(Mvx.Resolve<ITransactionRepository>()).GetValues(
                    DateTime.Today.GetFirstDayOfMonth(),
                    DateTime.Today.GetLastDayOfMonth());

            Mvx.Resolve<IUserNotification>()
                .UpdateMainTile(cashFlow.Income.Label, cashFlow.Spending.Label, cashFlow.Revenue.Label);

        }
Ejemplo n.º 2
0
        public void GetValues_SetupData_ListWithoutTransfer()
        {
            //Setup
            var transactionRepoSetup = new Mock<ITransactionRepository>();
            transactionRepoSetup.SetupAllProperties();

            var transactionRepo = transactionRepoSetup.Object;
            transactionRepo.Data = new ObservableCollection<FinancialTransaction>(new List<FinancialTransaction>
            {
                new FinancialTransaction
                {
                    Id = 1,
                    Type = (int) TransactionType.Income,
                    Date = DateTime.Today,
                    Amount = 60
                },
                new FinancialTransaction
                {
                    Id = 2,
                    Type = (int) TransactionType.Spending,
                    Date = DateTime.Today,
                    Amount = 50
                },
                new FinancialTransaction
                {
                    Id = 3,
                    Type = (int) TransactionType.Transfer,
                    Date = DateTime.Today,
                    Amount = 40
                }
            });

            //Excution
            var result = new CashFlowProvider(transactionRepo).GetValues(DateTime.Today.AddDays(-3),
                DateTime.Today.AddDays(3));

            //Assertion
            result.Income.Value.ShouldBe(60);
            result.Spending.Value.ShouldBe(50);
            result.Revenue.Value.ShouldBe(10);
        }