Example #1
0
        public async System.Threading.Tasks.Task TestMonthlyTotalAsync()
        {
            await HomePageViewModel.CalcMonth();

            Assert.IsTrue(Decimal.Compare(HomePageViewModel.novTot, Convert.ToDecimal(204.28)) == 0);
            Assert.IsTrue(Decimal.Compare(HomePageViewModel.decTot, Convert.ToDecimal(75.00)) == 0);
            Assert.IsTrue(Decimal.Compare(HomePageViewModel.febTot, Convert.ToDecimal(52.76)) == 0);
        }
        /// <summary>
        /// OnAppearing method that calls ViewModel to prepare totals.
        /// </summary>
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            load.IsRunning = true;
            await HomePageViewModel.CalcMonth();

            load.IsRunning       = false;
            remainingBudget.Text = Convert.ToString("$" + HomePageViewModel.currentMonth);

            var Label = new Label();

            monthPicker.SetBinding(Label.TextProperty, new Binding("SelectedItem", source: monthList));
        }
Example #3
0
        public async System.Threading.Tasks.Task TestRemainingBudget()
        {
            await HomePageViewModel.CalcMonth();

            Assert.IsTrue(Decimal.Compare(HomePageViewModel.currentMonth, Convert.ToDecimal(925.00)) < 0);
        }
Example #4
0
        public async System.Threading.Tasks.Task TestDailyTotalAsync()
        {
            await HomePageViewModel.CalcMonth();

            Assert.IsTrue(Decimal.Compare(HomePageViewModel.dailyTot, Convert.ToDecimal(75.00)) == 0);
        }