예제 #1
0
        public void NullSrIsValidForMapping()
        {
            Mock <VDI>          vdi  = ObjectManager.NewXenObject <VDI>(id);
            LunPerVdiPickerItem item = new LunPerVdiPickerItem(null, vdi.Object);

            Assert.That(item.IsValidForMapping, Is.False);
        }
예제 #2
0
        public void NullVdiInBaseObjectEquals()
        {
            LunPerVdiPickerItem nullItem = new LunPerVdiPickerItem(null, null);
            Mock <VDI>          vdiA     = ObjectManager.NewXenObject <VDI>(id);
            LunPerVdiPickerItem item     = new LunPerVdiPickerItem(null, vdiA.Object);

            Assert.That(nullItem.Equals(item), Is.False);
        }
예제 #3
0
        public bool IsValidForMapping(bool lunPerVDI)
        {
            Mock <SR> sr = ObjectManager.NewXenObject <SR>(id);

            sr.Setup(s => s.HBALunPerVDI()).Returns(lunPerVDI);
            Mock <VDI>          vdi  = ObjectManager.NewXenObject <VDI>(id);
            LunPerVdiPickerItem item = new LunPerVdiPickerItem(sr.Object, vdi.Object);

            return(item.IsValidForMapping);
        }
예제 #4
0
        public void NullVdiInComparisonObjectEquals()
        {
            LunPerVdiPickerItem nullItem = new LunPerVdiPickerItem(null, null);
            Mock <VDI>          vdi      = ObjectManager.NewXenObject <VDI>(id);

            vdi.Setup(v => v.Name()).Returns("NAME");
            LunPerVdiPickerItem item = new LunPerVdiPickerItem(null, vdi.Object);

            Assert.That(item.Equals(nullItem), Is.False);
            vdi.Verify(v => v.Name());
        }
예제 #5
0
        public void VdiBaseEqualsIsCalled()
        {
            Mock <VDI> vdiA = ObjectManager.NewXenObject <VDI>(id);

            vdiA.Object.opaque_ref = "OREF1";
            LunPerVdiPickerItem itemA = new LunPerVdiPickerItem(null, vdiA.Object);

            Mock <VDI> vdiB = ObjectManager.NewXenObject <VDI>(id);

            vdiB.Object.opaque_ref = "OREF2";
            LunPerVdiPickerItem itemB = new LunPerVdiPickerItem(null, vdiB.Object);

            Assert.That(itemB.Equals(itemA), Is.False);
        }
예제 #6
0
        public void NullEqualsReturnsFalse()
        {
            LunPerVdiPickerItem item = new LunPerVdiPickerItem(null, null);

            Assert.That(item.Equals(null), Is.False);
        }