Browse Source

SaveAsXML doesn't need to return anything

Piotr Czajkowski 3 years ago
parent
commit
aac1eb7831
2 changed files with 3 additions and 8 deletions
  1. 1 5
      PSDText/PSDText.cs
  2. 2 3
      PSDTextTests/PSDTextTests.cs

+ 1 - 5
PSDText/PSDText.cs

@@ -103,17 +103,13 @@ namespace PSDText
         /// Serializes text layers as XML.
         /// </summary>
         /// <param name="path">Output XML path.</param>
-        /// <returns>True on successful serialization,
-        /// false if there's nothing to write.</returns>
-        public bool SaveAsXML(string path)
+        public void SaveAsXML(string path)
         {
             var serializer = new XmlSerializer(typeof(List<TextData>));
             using (var sr = new StreamWriter(path))
             {
                 serializer.Serialize(sr, TextData);
             }
-
-            return true;
         }
 
         /// <summary>

+ 2 - 3
PSDTextTests/PSDTextTests.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.IO;
 using Xunit;
 
@@ -20,10 +20,9 @@ namespace PSDTextTests
         public void SaveAsXML()
         {
             var test = new PSDText.PSDText(TestFile);
-            Assert.NotEmpty(test.TextData);
 
             var destination = "./test.xml";
-            Assert.True(test.SaveAsXML(destination));
+            test.SaveAsXML(destination);
             Assert.True(File.Exists(destination));
             File.Delete(destination);
         }