Exemplo n.º 1
0
        public void SrPickerItemUpdateIgnoresUnsupportedSR(bool IsLunPerVdi)
        {
            //As the SrPickerLunPerVDIItem overides the base class call to HBALunePerVDI
            //then expect we don't get any calls to it when CanBeEnabled is also overridden

            //Setup the remainder of the mocks to return true for enabled
            Mock<SR> sr = ObjectManager.NewXenObject<SR>(id);
            sr.Setup(s => s.HBALunPerVDI).Returns(IsLunPerVdi);
            sr.Setup(s => s.ShowInVDISRList(false)).Returns(true); //ShowHiddenVDIs == true

            SrPickerLunPerVDIItem item = new SrPickerLunPerVDIItemNoImage(sr.Object);
            Assert.That(item.Show, Is.True);
            sr.Verify(s=>s.HBALunPerVDI, Times.Never());
        }