コード例 #1
0
        public void Task_02_Unselect()
        {
            var c = new RadioSelectionContainer <SelectionItem>();

            c.Select(A);
            c.Unselect(A);
            c.SelectedItems.Should().BeEquivalentTo(A);
        }
コード例 #2
0
 public SelectionContainerViewModel()
 {
     Items = new ObservableCollection <DataItem> {
         a, b, c, d, e
     };
     SingleSelectionContainer   = new SingleSelectionContainer <DataItem>(b);
     RadioSelectionContainer    = new RadioSelectionContainer <DataItem>(a);
     MultipleSelectionContainer = new MultipleSelectionContainer <DataItem>(new[] { c, d, e });
     SelectCommand = new NotifiableCommand(HandleSelect, () => true);
     ClearCommand  = new NotifiableCommand(HandleClear, () => true);
 }
コード例 #3
0
        public void Task_01_Empty_Access()
        {
            var c = new RadioSelectionContainer <SelectionItem>();

            Assert.Throws <InvalidOperationException>(() => c[A].Should().BeFalse());
        }