Beispiel #1
0
 private void CannotDoScenario(SrPicker.SRPickerType type, IEnumerable<TestData> testData)
 {
     int count = 0;
     foreach (TestData data in testData)
     {
         SrPickerItem item = factory.PickerItem(data.Sr, type, data.Affinity,
                                              data.DiskSize, data.VdisToMove);
         Assert.That(item.Show, Is.True, "Item Shown: Item " + count);
         Assert.That(item.Enabled, Is.False, "Item Enabled: Item " + count);
         Assert.That(item.Description, Is.EqualTo(data.ExpectedFailureDescription), "Item Reason: Item " + count);
         count++;
     }
 }
Beispiel #2
0
 private void CanDoScenario(SrPicker.SRPickerType type, IEnumerable<TestData> testData)
 {
     int count = 0;
     foreach (TestData data in testData)
     {
         SrPickerItem item = factory.PickerItem(data.Sr, type, data.Affinity,
                                              data.DiskSize, data.VdisToMove);
         Assert.That(item.Show, Is.True, "Item Shown: Item " + count);
         Assert.That(item.Enabled, Is.True, "Item Enabled: Item " + count);
         count++;
     }
 }
Beispiel #3
0
        public NewDiskDialog(IXenConnection connection, VM vm, SrPicker.SRPickerType PickerUsage, VDI diskTemplate, Host affinity, bool canResize, long minSize, IEnumerable<VDI> vdiNamesInUse)
            : this(connection, vdiNamesInUse)
        {
            TheVM = vm;
            DiskTemplate = diskTemplate;
            CanResize = canResize;
            MinSize = minSize;
            this.PickerUsage = PickerUsage;
            SrListBox.SetAffinity(affinity);

            Pool pool_sr = Helpers.GetPoolOfOne(connection);
            if (pool_sr != null)
            {
                SrListBox.DefaultSR = connection.Resolve(pool_sr.default_SR); //if default sr resolves to null the first sr in the list will be selected
            }
            SrListBox.selectDefaultSROrAny();

            LoadValues();
        }