Exemplo n.º 1
0
 private void AddProfile_Click(object sender, EventArgs e)
 {
     using OpenFileDialog dialog = new OpenFileDialog
           {
               Filter = "DayZ Profiles|*_settings.DayZProfile|All files|*.*"
           };
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         logger.Debug($"Adding custom profile location: {dialog.FileName}");
         ServerSelectionItem item = serverList.SaveProfile(dialog.FileName);
         SelectionCombo.SelectedItem = item;
     }
 }
        public void SaveProfileAddsLatestServerSourceForGivenFilenameAndDoesNotChangeSelectedIndex()
        {
            comboBox.SelectedIndex = 1;

            ServerSelectionItem item = list.SaveProfile(@"X:\path\to\some.DayZProfile");

            Assert.AreEqual(1, comboBox.SelectedIndex);

            Assert.AreEqual(3, list.Count);
            Assert.AreEqual(@"Most Recent (X:\path\to\some.DayZProfile)", list[2].DisplayName);
            Assert.IsInstanceOfType(list[2].GetSource(), typeof(LatestServerSource));

            Assert.AreEqual(list[2], item);
        }