コード例 #1
0
            public void WhenNullPackageSpecifiedReturnEmptyString()
            {
                var viewModel = new WelcomeViewModel(Mock.Of<IScreen>()) {
                    PackageMetadata = null
                };

                Assert.Equal("", viewModel.Title);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
            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);
            }
コード例 #4
0
            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);
            }