コード例 #1
0
        public void Items_Updates_WhenStoreValueChanges()
        {
            _store.SetState(AppState.SampleState);
            var sut = new ItemListViewModel(_store);

            // have to use ID of existing item or lookup in ItemViewCellModel will break
            var newIndex = ImmutableList <Guid> .Empty.Add(AppState.SampleState.Index[1]);

            _store.Publish(Projections.Index, newIndex);

            Assert.Equal(newIndex.Count, sut.Items.Count);
        }
コード例 #2
0
        public void ToggleValue_Updates_WhenStoreValueChanges()
        {
            var newItem = _testItem.WithToggleValue(true);

            _store.Publish(Projections.Item, newItem.ID, newItem);
            Assert.Equal(newItem.ToggleValue, _sut.ToggleValue);
        }
コード例 #3
0
        public void CounterValue_Updates_WhenStoreValueChanges()
        {
            var sut = new MainPageModel(_store);

            _store.Publish(Projections.CounterValue, 5);
            Assert.Equal(5, sut.CounterValue);
        }