private void InitDiskBtn_Click(object sender, EventArgs e) { CheckedListBox.CheckedItemCollection selecets = ISCSiCheckedListBox.CheckedItems; foreach (string item in selecets) { try { ISCSiInfo info = GetSelectVolum(item); bool result = ISCSiAPI.InitializeDisk(info.Number); if (!result) { MessageBox.Show("Initialize disk " + item + "Success."); } else { MessageBox.Show("Initialize disk " + item + "Success."); } } catch (Exception ex) { logger.Error(ex.ToString()); MessageBox.Show("InitDisk error: " + ex.Message); } } }
public void InitializeDiskTest() { int diskNumber = 0; // TODO: 初始化為適當值 bool expected = false; // TODO: 初始化為適當值 bool actual; actual = ISCSiAPI.InitializeDisk(diskNumber); Assert.AreEqual(expected, actual); }