public void CanAddFunctionWrapperAroundJson() { string filePath = @"d:\output\pickledFeatures.json"; FileSystem.AddFile(filePath, "\r\n[]\r\n"); var jsonTweaker = new JsonTweaker(FileSystem); jsonTweaker.AddJsonPWrapperTo(filePath); var expected = "jsonPWrapper (\r\n[]\r\n);"; var actual = FileSystem.File.ReadAllText(filePath); Check.That(actual).IsEqualTo(expected); }
public void CanRenameJsonFile() { string oldfilePath = @"d:\output\pickledFeatures.json"; string newFilePath = @"d:\output\pickledFeatures.js"; MockFileSystem.AddFile(oldfilePath, "test data"); var jsonTweaker = new JsonTweaker(MockFileSystem); jsonTweaker.RenameFileTo(oldfilePath, newFilePath); Assert.IsTrue(MockFileSystem.File.Exists(newFilePath)); Assert.IsFalse(MockFileSystem.File.Exists(oldfilePath)); }
public void CanAddFunctionWrapperAroundJson() { string filePath = @"d:\output\pickledFeatures.json"; MockFileSystem.AddFile(filePath, "\r\n[]\r\n"); var jsonTweaker = new JsonTweaker(MockFileSystem); jsonTweaker.AddJsonPWrapperTo(filePath); var expected = "jsonPWrapper (\r\n[]\r\n);"; Assert.AreEqual(expected, MockFileSystem.File.ReadAllText(filePath)); }
public void CanRenameJsonFile() { string oldfilePath = @"d:\output\pickledFeatures.json"; string newFilePath = @"d:\output\pickledFeatures.js"; FileSystem.AddFile(oldfilePath, "test data"); var jsonTweaker = new JsonTweaker(FileSystem); jsonTweaker.RenameFileTo(oldfilePath, newFilePath); var doesNewPathExist = FileSystem.File.Exists(newFilePath); Check.That(doesNewPathExist).IsTrue(); var doesOldPathExist = FileSystem.File.Exists(oldfilePath); Check.That(doesOldPathExist).IsFalse(); }