PSDTextTests.cs 1020 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.IO;
  2. using Xunit;
  3. namespace PSDTextTests
  4. {
  5. public class PSDTextTests
  6. {
  7. private const string TestFile = "./testFiles/test.psd";
  8. [Fact]
  9. public void ReadXMLFromPSD()
  10. {
  11. var test = new PSDText.PSDText(TestFile);
  12. Assert.NotEmpty(test.TextData);
  13. }
  14. [Fact]
  15. public void SaveAsXML()
  16. {
  17. var test = new PSDText.PSDText(TestFile);
  18. Assert.NotEmpty(test.TextData);
  19. var destination = "./test.xml";
  20. test.SaveAsXML(destination);
  21. Assert.True(File.Exists(destination));
  22. File.Delete(destination);
  23. }
  24. [Fact]
  25. public void SaveAsJSON()
  26. {
  27. var test = new PSDText.PSDText(TestFile);
  28. Assert.NotEmpty(test.TextData);
  29. var destination = "./test.json";
  30. test.SaveAsJSON(destination);
  31. Assert.True(File.Exists(destination));
  32. File.Delete(destination);
  33. }
  34. }
  35. }