public void WhenNullPackageSpecifiedReturnEmptyString() { var viewModel = new WelcomeViewModel(Mock.Of<IScreen>()) { PackageMetadata = null }; Assert.Equal("", viewModel.Title); }
public void WhenPackageSpecifiesNoTitleFallbackToId() { var package = Mock.Of<IPackage>(p => p.Id == "MyApp" && p.Title == ""); var viewModel = new WelcomeViewModel(Mock.Of<IScreen>()) { PackageMetadata = package }; Assert.Equal("MyApp", viewModel.Title); }
public void WhenPackageSpecifiesATitleUseIt() { var package = Mock.Of<IPackage>(p => p.Title == "My App Title"); var viewModel = new WelcomeViewModel(Mock.Of<IScreen>()) { PackageMetadata = package }; Assert.Equal("My App Title", viewModel.Title); }
public void WhenPackageSpecifiesValueItIsDisplayed() { var package = Mock.Of<IPackage>(p => p.Description == "My App Description"); var viewModel = new WelcomeViewModel(Mock.Of<IScreen>()) { PackageMetadata = package }; Assert.Equal("My App Description", viewModel.Description); }