public void Deselect_NoObeserverDoesNotThrowException() { BasicObservableSelectable _selectable = instantiateSelectable(); _selectable.Select(); Assert.DoesNotThrow(() => _selectable.Deselect()); }
public void DeselectWithoutSelect_ThrowsException() { BasicObservableSelectable _selectable = instantiateSelectable(); Assert.Throws <Selectable.NotSelectedException>( () => _selectable.Deselect()); }
public void IsSelected_FalseAfterDeselect() { BasicObservableSelectable _selectable = instantiateSelectable(); _selectable.Select(); _selectable.Deselect(); Assert.False(_selectable.IsSelected); }
public void Deselect_OnDeselectInvoked() { BasicObservableSelectable _selectable = instantiateSelectable(); bool isDeselected = false; Action onDeselected = () => { isDeselected = true; }; _selectable.OnDeselection += onDeselected; _selectable.Select(); _selectable.Deselect(); Assert.True(isDeselected); _selectable.OnDeselection -= onDeselected; }
public void IsSelected_FalseAfterInvocationOfOnDeselection() { BasicObservableSelectable _selectable = instantiateSelectable(); bool isSelected = true; Action onDeselected = () => { isSelected = _selectable.IsSelected; }; _selectable.OnDeselection += onDeselected; _selectable.Select(); _selectable.Deselect(); Assert.False(isSelected); _selectable.OnDeselection -= onDeselected; }