Example #1
0
        public WalkEntryPage()
        {
            InitializeComponent();

            Title          = "New Walk Entry Page";
            BindingContext = new WalkEntryPageViewModel(DependencyService.Get <INavigationService>());
            SetBinding(TitleProperty, new Binding(BaseViewModel.PageTitlePropertyName));
        }
Example #2
0
        public WalkEntryPage()
        {
            InitializeComponent();

            // Update the Title and Initialise our BindingContext for the Page
            Title          = "New Walk Entry Page";
            BindingContext = new WalkEntryPageViewModel();
            SetBinding(TitleProperty, new Binding(BaseViewModel.PageTitlePropertyName));
        }
        public async Task CheckIfDifficultyIsEqual()
        {
            var navMock   = new Mock <INavigationService>().Object;
            var viewModel = new WalkEntryPageViewModel(navMock);

            // Arrange
            viewModel.Difficulty = "Easy";

            // Act
            await viewModel.Init();

            // Assert
            Assert.Equal("Hard", viewModel.Difficulty);
        }
        public async Task CheckIfDistanceIsNotEqual()
        {
            var navMock   = new Mock <INavigationService>().Object;
            var viewModel = new WalkEntryPageViewModel(navMock);

            // Arrange
            viewModel.Distance = 256;

            // Act
            await viewModel.Init();

            // Assert
            Assert.NotEqual("0", viewModel.Difficulty);
        }
        public async Task CheckIfEntryTitleIsEqual()
        {
            var navMock   = new Mock <INavigationService>().Object;
            var viewModel = new WalkEntryPageViewModel(navMock);

            // Arrange
            viewModel.Title = "New Walk Entry";

            // Act
            await viewModel.Init();

            // Assert
            Assert.Equal("New Walk Entry", viewModel.Title);
        }