A fork of Eusth's IPA
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

36 řádky
1.5KB

  1. using System.IO;
  2. using System.Linq;
  3. using Xunit;
  4. namespace IPA.Tests
  5. {
  6. public class ProgramTest
  7. {
  8. [Theory]
  9. // Unrelated path
  10. [InlineData("test/from.dll", "test/to.dll", "native", false, new string[] { "test/to.dll" })]
  11. // Flat -> Not-Flat
  12. [InlineData("native/from.dll", "native/to.dll", "native", false, new string[] { "native/x86/to.dll", "native/x86_64/to.dll" })]
  13. // Flat -> Flat
  14. [InlineData("native/from.dll", "native/to.dll", "native", true, new string[] { "native/to.dll" })]
  15. // Not-Flat -> Flat
  16. [InlineData("native/x86/from.dll", "native/x86/to.dll", "native", true, new string[] { })]
  17. [InlineData("native/x86_64/from.dll", "native/x86_64/to.dll", "native", true, new string[] { "native/to.dll" })]
  18. // Not-flat -> Not-Flat
  19. [InlineData("native/x86/from.dll", "native/x86/to.dll", "native", false, new string[] { "native/x86/to.dll" })]
  20. [InlineData("native/x86_64/from.dll", "native/x86_64/to.dll", "native", false, new string[] { "native/x86_64/to.dll" })]
  21. public void CopiesCorrectly(string from, string to, string nativeFolder, bool isFlat, string[] expected)
  22. {
  23. var outcome = Program.NativePluginInterceptor(new FileInfo(from), new FileInfo(to), new DirectoryInfo(nativeFolder), isFlat, Program.Architecture.Unknown).Select(f => f.FullName).ToList();
  24. var expectedPaths = expected.Select(e => new FileInfo(e)).Select(f => f.FullName).ToList();
  25. Assert.Equal(expectedPaths, outcome);
  26. }
  27. }
  28. }