示例#1
0
        public void Constructor_DoesNotCreatePlaceholder_OrSetChildren_WhenMarkedAsChildless()
        {
            var sut = new TestTreeViewItemViewModel(Services, childless: true);

            Assert.IsNull(sut.LoadingPlaceholder);
            Assert.IsNull(sut.Children);
        }
示例#2
0
        public void TestInit()
        {
            RenewMockServices();

            _collpasedTvivm = new TestTreeViewItemViewModel(Services);
            _expandedTvivm  = new TestTreeViewItemViewModel(Services)
            {
                IsExpanded = true,
            };

            // ignore first mock task invocation caused by initial expansion
            MockThreadingService.Invocations.Clear();
        }
示例#3
0
        public void Constructor_Initializes()
        {
            var sut = new TestTreeViewItemViewModel(Services);

            Assert.AreSame(Services, sut.Services);
            Assert.IsNotNull(sut.CloudFoundryService);

            Assert.IsFalse(sut.IsLoading);

            /* loading placeholder gets instantiated */
            Assert.IsNotNull(sut.LoadingPlaceholder);
            Assert.AreEqual(TreeViewItemViewModel._defaultLoadingMsg, sut.LoadingPlaceholder.DisplayText);

            /* children set to loading placeholder */
            Assert.AreEqual(1, sut.Children.Count);
            Assert.AreEqual(sut.LoadingPlaceholder, sut.Children[0]);
        }