AliaSQL.Core.ResourceFileLocator.FileExists C# (CSharp) Method

FileExists() public method

public FileExists ( string assembly, string resourceName ) : bool
assembly string
resourceName string
return bool
        public bool FileExists(string assembly, string resourceName)
        {
            Stream stream = constructStream(assembly, resourceName);
            bool fileExists = stream != null;
            return fileExists;
        }

Usage Example

Example #1
0
		public void All_sql_files_should_be_included_as_embedded_resources()
		{
			string assembly = SqlDatabaseManager.SQL_FILE_ASSEMBLY;
			string template = SqlDatabaseManager.SQL_FILE_TEMPLATE;

			IResourceFileLocator locator = new ResourceFileLocator();

            Assert.That(locator.FileExists(assembly, string.Format(template, "CreateSchema")));
            Assert.That(locator.FileExists(assembly, string.Format(template, "CreateTestDataSchema")));
			Assert.That(locator.FileExists(assembly, string.Format(template, "DropConnections")));
			Assert.That(locator.FileExists(assembly, string.Format(template, "VersionDatabase")));

		}