Hi All,
I Used telerik:ListBox Control which has selection changed Event and for this event I was writing Unit Test code(X-Unit).
VM Code:
var selectionChangedEventArg = parameter as System.Windows.Controls.SelectionChangedEventArgs;
if (selectionChangedEventArg != null && selectionChangedEventArg.OriginalSource != null)
{}
TEST CODE:
////Arrange
System.Windows.Controls.SelectionChangedEventArgs obj =
new System.Windows.Controls.SelectionChangedEventArgs(routedEvent, removedItems, addedItems);
////Act
detailViewModel.SelectionChangedCommand.Execute(obj);
selectionChangedEventArg.OriginalSource was null when the method is called from Test method. Any idea to make the original Source has value.