public void UnselectMethodTest()
        {
            var spreadsheetMock = new SpreadsheetView();
            var privateAccessor = new PrivateAccessor(spreadsheetMock);

            //Load data            
            Mock.NonPublic.Arrange(typeof(CellBase), "SetEditorParams").IgnoreInstance().DoNothing();
            spreadsheetMock.ItemsSource = new List<TestData> { new TestData { Text = "text 1" }, new TestData { Text = "another text" } };
            spreadsheetMock.OnApplyTemplate();
            var item1 = spreadsheetMock.ItemsCollection[0];
            var item2 = spreadsheetMock.ItemsCollection[1];

            //Call ItemContainerGenerator overrides
            var container = privateAccessor.CallMethod("GetContainerForItemOverride") as SpreadsheetItemContainer;
            Assert.IsNotNull(container);
            spreadsheetMock.ItemContainerStyle = new Style(typeof(SpreadsheetItemContainer));
            privateAccessor.CallMethod("PrepareContainerForItemOverride", container, item1);
            privateAccessor.CallMethod("PrepareContainerForItemOverride", (SpreadsheetItemContainer)null, item2);

            //Unselect cells from local spreadsheet
            Mock.Arrange(() => spreadsheetMock.Unselect(Arg.IsAny<CellBase>(), Arg.IsAny<SpreadsheetView>()));
            Mock.Arrange(() => container.Unselect(Arg.IsAny<CellBase>())).IgnoreInstance().OccursOnce();
            var cell = Mock.Create<CellBase>(Constructor.Mocked, Behavior.Loose);
            spreadsheetMock.Unselect(cell);
            Mock.Assert(container);

            //Create child spreadsheets
            var childSpreadsheet1 = Mock.Create<SpreadsheetView>(Constructor.Mocked, Behavior.Loose);
            Mock.Arrange(() => childSpreadsheet1.IsVisible).Returns(true);
            var childSpreadsheet2 = Mock.Create<SpreadsheetView>(Constructor.Mocked, Behavior.Loose);
            Mock.Arrange(() => childSpreadsheet2.IsVisible).Returns(false);
            var childSpreadsheet3 = Mock.Create<SpreadsheetView>(Constructor.Mocked, Behavior.Loose);
            Mock.Arrange(() => childSpreadsheet3.IsVisible).Returns(true);

            //Add child spreadsheets
            var childSpreadsheets = privateAccessor.GetField("_childSpreadsheets") as List<SpreadsheetView>;
            childSpreadsheets.Add(childSpreadsheet1);
            childSpreadsheets.Add(childSpreadsheet2);
            childSpreadsheets.Add(childSpreadsheet3);

            //Call method with child spreadsheets and with caller (the second argument)
            Mock.Arrange(() => spreadsheetMock.Unselect(Arg.IsAny<CellBase>(), Arg.IsAny<SpreadsheetView>())).CallOriginal();
            spreadsheetMock.Unselect(cell, childSpreadsheet1);
            Mock.Assert(() => childSpreadsheet1.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Never());
            Mock.Assert(() => childSpreadsheet2.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Never());
            Mock.Assert(() => childSpreadsheet3.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Once());

            //Call method with child spreadsheets
            Mock.Arrange(() => container.Unselect(Arg.IsAny<CellBase>())).IgnoreInstance().Occurs(2);
            spreadsheetMock.Unselect(cell);
            Mock.Assert(() => childSpreadsheet1.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Once());
            Mock.Assert(() => childSpreadsheet2.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Never());
            Mock.Assert(() => childSpreadsheet3.Unselect(cell, Arg.IsAny<SpreadsheetView>()), Occurs.Exactly(2));
        }