public void LoadingReturnsAccounts() { var service = new Services.ServiceClient(null); var vm = new ViewModels.AccountsViewModel(service, null); Thread.Sleep(defaultAsyncWait); //No accounts Assert.IsFalse((vm.Accounts == null || vm.Accounts.Count == 0), "Service did not return any accounts"); }
public void LoadingReturnsActiveAccounts() { var service = new Services.ServiceClient(null); var vm = new ViewModels.AccountsViewModel(service, null); Thread.Sleep(defaultAsyncWait); if (vm.Accounts != null) { bool hasInactive = vm.Accounts.Any(w => w.IsActive == false); //Active accounts Assert.IsFalse(hasInactive, "Service retuned inactive accounts"); } }
public void LoadingReturnsObsoleteAccounts() { var service = new Services.ServiceClient(null); var vm = new ViewModels.AccountsViewModel(service, null); Thread.Sleep(defaultAsyncWait); if (vm.Accounts != null) { DateTime minAccDate = new DateTime(2016, 1, 1); bool hasOld = vm.Accounts.Any(w => w.Registered < minAccDate); //Accounts registered after 2016 Assert.IsFalse(hasOld, $"Service retuned accounts registerd before {minAccDate.ToString("mm/DD/yyy")}"); } }
public AccountsPage() { InitializeComponent(); BindingContext = viewModel = new ViewModels.AccountsViewModel(); /*NavigationPage navigationPage = new NavigationPage(); * navigationPage.Title = "Expenses"; * * NavigationPage navigationPage1 = new NavigationPage(); * navigationPage1.Title = "Income"; */ Children.Add(new ExpIncAccPage("ExpenseAccount") { Title = "Expenses Account" }); Children.Add(new ExpIncAccPage("IncomeAccount") { Title = "Income Account" }); this.On <Android>().DisableSwipePaging(); this.CurrentPageChanged += AccountsPage_CurrentPageChanged; }