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!"); }
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(); }