Пример #1
0
        public void ShouldShowWelcomeMessageWhenUserNameIsNotNull()
        {
            var viewModel = new Example1PageViewModel {
                UserName = "******"
            };
            var screen = _renderer.Render <Example1Page>();

            screen.ProvideBingingContext(viewModel);

            screen.GetByType <StackLayout>().GetTextContent().Should().Be("Welcome back, Marvin!");
        }
Пример #2
0
        public void ShouldShowLoginMessageWhenUserNameIsNull()
        {
            var viewModel = new Example1PageViewModel {
                UserName = null
            };
            var screen = _renderer.Render <Example1Page>();

            screen.ProvideBingingContext(viewModel);

            screen.GetByType <StackLayout>().GetTextContent().Should().Be("Login");
        }
        public Example1Page()
        {
            InitializeComponent();

            BindingContext = new Example1PageViewModel();
        }