public void GetFilesFromCurrentAssembly_NoConfigFilesFound() { var configurationFileLocator = new ConfigurationFileLocator(); var files = configurationFileLocator.GetFilesFromCurrentAssembly (); Assert.That (files, Is.Empty); }
public void GetFilesFromParsedType() { var orignialAssemblyLocation = GetOrignialAssemblyLocation(); var sampleConfigLocation = Path.Combine (orignialAssemblyLocation, "Config\\SampleConfig.xml"); var expectedConfigLocation = Path.Combine (Path.GetDirectoryName(GetType().Assembly.Location), "config.injectioncop"); var typeNode = IntrospectionUtility.TypeNodeFactory<ConfigurationFileLocatorTest>(); try { File.Copy (sampleConfigLocation, expectedConfigLocation); var configurationFileLocator = new ConfigurationFileLocator(); var files = configurationFileLocator.GetFilesFromParsedType (typeNode); Assert.That (files, Contains.Item (Path.GetFullPath (expectedConfigLocation))); } finally { File.Delete (expectedConfigLocation); } }
public void GetFilesFromCurrentAssembly() { var configurationFileLocator = new ConfigurationFileLocator(); var orignialAssemblyLocation = GetOrignialAssemblyLocation(); var sampleConfigLocation = Path.Combine (orignialAssemblyLocation, "Config\\SampleConfig.xml"); var expectedConfigLocation = Path.Combine (Path.GetDirectoryName(configurationFileLocator.GetType().Assembly.Location), "config.injectioncop"); try { File.Copy (sampleConfigLocation, expectedConfigLocation); var files = configurationFileLocator.GetFilesFromCurrentAssembly (); Assert.That (files, Contains.Item (Path.GetFullPath (expectedConfigLocation))); } finally { File.Delete (expectedConfigLocation); } }
public void GetFilesFromParsedType_NoConfigFilesFound() { var typeNodeFactory = IntrospectionUtility.TypeNodeFactory<ConfigurationFileLocatorTest>(); var configurationFileLocator = new ConfigurationFileLocator(); var files = configurationFileLocator.GetFilesFromParsedType (typeNodeFactory); Assert.That (files, Is.Empty); }