Esempio n. 1
0
        public void Task_01_Empty_04_Unselect()
        {
            var c = new SingleSelectionContainer <SelectionItem>();

            c.Unselect(A);
            c.SelectedItems.Count.Should().Be(0);
        }
Esempio n. 2
0
        public void Task_01_Empty_03_Item_Not_Exists()
        {
            var c = new SingleSelectionContainer <SelectionItem>();

            c.SelectedItems.Count.Should().Be(0);
            c[A].Should().BeFalse();
        }
Esempio n. 3
0
        public void Task_02_Select_01_One()
        {
            var c = new SingleSelectionContainer <SelectionItem>();

            c.Select(A);
            c.SelectedItems.Count.Should().Be(1);
            c.SelectedItems.Should().BeEquivalentTo(A);
            c[A].Should().BeTrue();
        }
Esempio n. 4
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);
 }
Esempio n. 5
0
        public void Task_03_Unselect_02_Multiple()
        {
            var c = new SingleSelectionContainer <SelectionItem>();

            c.Select(A);
            c.Select(B);
            c.Select(C);
            c.Unselect(C);
            c.SelectedItems.Count.Should().Be(0);
            c.Unselect(B);
            c.SelectedItems.Count.Should().Be(0);
            c.Unselect(A);
            c.SelectedItems.Count.Should().Be(0);
        }
Esempio n. 6
0
        public void Task_01_Empty_02_Type_Mismatch_Access()
        {
            ISelectionContainer c = new SingleSelectionContainer <SelectionItem>();

            Assert.Throws <ArgumentException>(() => c[new object()].Should().BeFalse());
        }
Esempio n. 7
0
        public void Task_01_Empty_01_Null_Access()
        {
            var c = new SingleSelectionContainer <SelectionItem>();

            c[null].Should().BeFalse();
        }
Esempio n. 8
0
        public void Task_04_Create_With_Initial_Selection()
        {
            var c = new SingleSelectionContainer <SelectionItem>(A);

            c.SelectedItems.Should().BeEquivalentTo(A);
        }
Esempio n. 9
0
 protected FileSystemTreeViewModel()
 {
     SelectionContainer = new SingleSelectionContainer <ITreeNode>();
 }