public virtual void ShouldHandleClearingTheSelectedIndicesProperty() { Accordion a = new Accordion(); IList<int> original = a.SelectedIndices; bool exceptionThrown = false; try { a.SetValue(Accordion.SelectedIndicesProperty, null); } catch (InvalidOperationException) { exceptionThrown = true; } Assert.IsTrue(exceptionThrown); Assert.IsTrue(a.SelectedIndices.Count == 0); Assert.IsTrue(original == a.SelectedIndices); // reset test exceptionThrown = false; try { a.ClearValue(Accordion.SelectedIndicesProperty); } catch (InvalidOperationException) { exceptionThrown = true; } Assert.IsTrue(exceptionThrown); Assert.IsTrue(a.SelectedIndices.Count == 0); Assert.IsTrue(original == a.SelectedIndices); }