public void CreateNewLangProject_DbExists()
        {
            DummyFwNewLangProjectCreator dlg = new DummyFwNewLangProjectCreator();

            List <string> preExistingFiles =
                new List <string>(Directory.GetFiles(DirectoryFinder.DataDirectory));
            List <string> postExistingFiles = null;
            string        createdDBName1    = string.Empty;
            string        createdDBName2    = string.Empty;

            try
            {
                string sNewDbFileName;
                string sNewLogFileName;
                dlg.CallCreateNewDbFiles("whataboutbob", out sNewDbFileName, out sNewLogFileName);
                createdDBName1 = dlg.CallAttachDatabase(sNewDbFileName, sNewLogFileName);

                dlg.CallCreateNewDbFiles("whataboutbob", out sNewDbFileName, out sNewLogFileName);
                createdDBName2 = dlg.CallAttachDatabase(sNewDbFileName, sNewLogFileName);

                postExistingFiles =
                    new List <string>(Directory.GetFiles(DirectoryFinder.DataDirectory));
            }
            finally
            {
                FwNewLangProjectTests.DestroyDb(createdDBName1, false);
                FwNewLangProjectTests.DestroyDb(createdDBName2, false);
                // Blow away the files to clean things up
                if (postExistingFiles == null)
                {
                    postExistingFiles =
                        new List <string>(Directory.GetFiles(DirectoryFinder.DataDirectory));
                }
                foreach (string fileName in postExistingFiles)
                {
                    try
                    {
                        if (!preExistingFiles.Contains(fileName))
                        {
                            File.Delete(fileName);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
        public void CreateNewLangProject_NameWithSingleQuote()
        {
            DummyFwNewLangProjectCreator creator = new DummyFwNewLangProjectCreator();

            string dbName = "!!t'st";
            string dbFileName;
            string logFileName;

            creator.CallCreateNewDbFiles(dbName, out dbFileName, out logFileName);
            string createdName = creator.CallAttachDatabase(dbFileName, logFileName);

            Assert.AreEqual(dbName, createdName);

            string dbFileBase = Path.GetFileNameWithoutExtension(dbFileName);

            Assert.AreEqual(dbName, dbFileBase);
        }
		public void CreateNewLangProject_NameWithSingleQuote()
		{
			DummyFwNewLangProjectCreator creator = new DummyFwNewLangProjectCreator();

			string dbName = "!!t'st";
			string dbFileName;
			string logFileName;

			creator.CallCreateNewDbFiles(dbName, out dbFileName, out logFileName);
			string createdName = creator.CallAttachDatabase(dbFileName, logFileName);

			Assert.AreEqual(dbName, createdName);

			string dbFileBase = Path.GetFileNameWithoutExtension(dbFileName);
			Assert.AreEqual(dbName, dbFileBase);
		}
		public void CreateNewLangProject_DbExists()
		{
			DummyFwNewLangProjectCreator dlg = new DummyFwNewLangProjectCreator();

			List<string> preExistingFiles =
				new List<string>(Directory.GetFiles(DirectoryFinder.DataDirectory));
			List<string> postExistingFiles = null;
			string createdDBName1 = string.Empty;
			string createdDBName2 = string.Empty;

			try
			{
				string sNewDbFileName;
				string sNewLogFileName;
				dlg.CallCreateNewDbFiles("whataboutbob", out sNewDbFileName, out sNewLogFileName);
				createdDBName1 = dlg.CallAttachDatabase(sNewDbFileName, sNewLogFileName);

				dlg.CallCreateNewDbFiles("whataboutbob", out sNewDbFileName, out sNewLogFileName);
				createdDBName2 = dlg.CallAttachDatabase(sNewDbFileName, sNewLogFileName);

				postExistingFiles =
					new List<string>(Directory.GetFiles(DirectoryFinder.DataDirectory));

			}
			finally
			{
				FwNewLangProjectTests.DestroyDb(createdDBName1, false);
				FwNewLangProjectTests.DestroyDb(createdDBName2, false);
				// Blow away the files to clean things up
				if (postExistingFiles == null)
				{
					postExistingFiles =
						new List<string>(Directory.GetFiles(DirectoryFinder.DataDirectory));
				}
				foreach (string fileName in postExistingFiles)
				{
					try
					{
						if (!preExistingFiles.Contains(fileName))
							File.Delete(fileName);
					}
					catch
					{
					}
				}
			}
		}