AddConverterDlgTests.CnvtrPropertiesControlTests.SelectMapping_BogusCompiledTecKitFile C# (CSharp) Method

SelectMapping_BogusCompiledTecKitFile() private method

private SelectMapping_BogusCompiledTecKitFile ( ) : void
return void
		public void SelectMapping_BogusCompiledTecKitFile()
		{
			m_bogusFileName = CreateTempFile(new string[] { "bogus contents" }, "tec");

			// This is a type we don't recognize.
			m_myDlg.m_cnvtrPropertiesCtrl.txtName.Text = "ZZZUnitTestBogusTecKitFile";

			int i;
			for (i = 0; i < m_myDlg.m_cnvtrPropertiesCtrl.cboConverter.Items.Count; ++i)
			{
				if (((CnvtrTypeComboItem)m_myDlg.m_cnvtrPropertiesCtrl.cboConverter.Items[i]).Type == ConverterType.ktypeTecKitTec)
				{
					m_myDlg.m_cnvtrPropertiesCtrl.cboConverter.SelectedIndex = i;
					break;
				}
			}
			Assert.IsTrue(i < m_myDlg.m_cnvtrPropertiesCtrl.cboConverter.Items.Count, "Should find a TecKitTec type converter listed.");
			for (i = 0; i < m_myDlg.m_cnvtrPropertiesCtrl.cboConversion.Items.Count; ++i)
			{
				if (((CnvtrDataComboItem)m_myDlg.m_cnvtrPropertiesCtrl.cboConversion.Items[i]).Type == ConvType.Legacy_to_Unicode)
				{
					m_myDlg.m_cnvtrPropertiesCtrl.cboConversion.SelectedIndex = i;
					break;
				}
			}
			Assert.IsTrue(i < m_myDlg.m_cnvtrPropertiesCtrl.cboConversion.Items.Count, "Should find a Legacy_to_Unicode conversion listed.");

			m_myDlg.SetMappingFile(m_bogusFileName);

			Assert.IsFalse(m_myDlg.InstallConverter(), "Should not be able to install bogus compiled TecKit file.");
			// This may not be testing what we want it to test...
			// Might want make an assert on the error message that is produced!
		}