Browse Source

SaveAsJSON doesn't need to return anything

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

+ 1 - 5
PSDText/PSDText.cs

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

+ 1 - 2
PSDTextTests/PSDTextTests.cs

@@ -37,10 +37,9 @@ namespace PSDTextTests
         public void SaveAsJSON()
         {
             var test = new PSDText.PSDText(TestFile);
-            Assert.NotEmpty(test.TextData);
 
             var destination = "./test.json";
-            Assert.True(test.SaveAsJSON(destination));
+            test.SaveAsJSON(destination);
             Assert.True(File.Exists(destination));
             File.Delete(destination);
         }