public void GetModulePaths_WithoutCounterPattern_WithoutGeneratedFiles_ReturnsEmptyList() { var tempDirectory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())); try { var factory = new MixerPipelineFactory("Assembly", 1); File.Create(Path.Combine(tempDirectory.FullName, "AssemblyOther.dll")).Close(); Assert.That(factory.GetModulePaths(tempDirectory.FullName), Is.Empty); } finally { tempDirectory.Delete(true); } }
public void GetModulePaths_WithCounterPattern_WithGeneratedFiles_ReturnsMatchingFiles() { var tempDirectory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())); try { var factory = new MixerPipelineFactory("Assembly.{counter}", 1); var assembly1 = Path.Combine(tempDirectory.FullName, "Assembly.1.dll"); File.Create(assembly1).Close(); var assembly2 = Path.Combine(tempDirectory.FullName, "Assembly.2.dll"); File.Create(assembly2).Close(); File.Create(Path.Combine(tempDirectory.FullName, "AssemblyOther.dll")).Close(); Assert.That(factory.GetModulePaths(tempDirectory.FullName), Is.EqualTo(new[] { assembly1, assembly2 })); } finally { tempDirectory.Delete(true); } }