public void Task_01_Empty_04_Unselect() { var c = new SingleSelectionContainer <SelectionItem>(); c.Unselect(A); c.SelectedItems.Count.Should().Be(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(); }
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(); }
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); }
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); }
public void Task_01_Empty_02_Type_Mismatch_Access() { ISelectionContainer c = new SingleSelectionContainer <SelectionItem>(); Assert.Throws <ArgumentException>(() => c[new object()].Should().BeFalse()); }
public void Task_01_Empty_01_Null_Access() { var c = new SingleSelectionContainer <SelectionItem>(); c[null].Should().BeFalse(); }
public void Task_04_Create_With_Initial_Selection() { var c = new SingleSelectionContainer <SelectionItem>(A); c.SelectedItems.Should().BeEquivalentTo(A); }
protected FileSystemTreeViewModel() { SelectionContainer = new SingleSelectionContainer <ITreeNode>(); }