public void GetCargoHoldWindowShouldQueryForCargoHoldWindow() { //Arrange var eveInvWindow = new Mock <IEveInvWindow>(); eveInvWindow.Setup(eiw => eiw.IsValid).Returns(true); _eveWindowProvider.Setup(ewp => ewp.GetInventoryWindow()).Returns(eveInvWindow.Object); var eveInvChildWindow = new Mock <IEveInvChildWindow>(); eveInvChildWindow.Setup(eicw => eicw.IsValid).Returns(true); eveInvWindow.Setup(eiw => eiw.GetChildWindow(It.Is <Int64>(i => i == 1), It.Is <string>(s => s == InventoryProvider.ShipCargoName))) .Returns(eveInvChildWindow.Object); _shipCache.Setup(sc => sc.Id).Returns(1); //Act var cargoHoldWindow = _inventoryProvider.GetCargoHoldWindow(); //Assert _eveWindowProvider.Verify(ewp => ewp.GetInventoryWindow(), Times.Once()); eveInvWindow.Verify(eiw => eiw.GetChildWindow(It.Is <Int64>(i => i == 1), It.Is <string>(s => s == InventoryProvider.ShipCargoName)), Times.Once()); Assert.IsNotNull(cargoHoldWindow); Assert.IsTrue(cargoHoldWindow.IsValid); }