protected override void OnAppearing() { CityEventsListViewModel vm = new CityEventsListViewModel(Navigation); vm.SetCityEvents(vm.setListOfEvents(vm.eventRepository)); this.BindingContext = vm; }
public CityEventsListView() { InitializeComponent(); CityEventsListViewModel vm = new CityEventsListViewModel(Navigation); vm.SetCityEvents(vm.setListOfEvents(vm.eventRepository)); this.BindingContext = vm; }
public void TestValuesSetForViewModel() { Mock <CityEventRepository> mock = new Mock <CityEventRepository>(null); mock.Setup(a => a.GetAllCityEvents()).Returns(allEvents); Mock <INavigation> mockNav = new Mock <INavigation>(); CityEventsListViewModel mylv = new CityEventsListViewModel(mockNav.Object); var ListOfCityEvents = mylv.setListOfEvents(mock.Object); Assert.IsTrue(ListOfCityEvents.Count() > 0); }