public void TestComments()
        {
            string filePath = "\\test" + _testCulture + ".properties";
              string data = "#comment1" + Environment.NewLine + "//comment2" + Environment.NewLine + "--comment3" + Environment.NewLine + "testKey=testValue#--//" + Environment.NewLine + Environment.NewLine;

              string fullTempPath = Path.GetTempPath() + filePath;
              File.WriteAllBytes(fullTempPath, Encoding.UTF8.GetBytes(data));

              try
              {
            LocalizableMessageStorage messageStorage = new LocalizableMessageStorage(Path.GetTempPath(), FilePattern);
            File.Delete(Environment.CurrentDirectory + filePath);
            Assert.AreEqual(messageStorage.GetLocalizedMessage(_testCulture, "testKey"), "testValue#--//", "Messages do not match the input to the file");
            Assert.AreEqual(1, messageStorage.GetMessagesCountForLocale(_testCulture), "There should only have been one actual message in this file.");
              }
              catch (Exception ex)
              {
            Assert.Fail("LocalizableMessageStorage should not have thrown an exception: {0}", ex);
              }
        }
        public void TestSpecialCharacters()
        {
            string filePath = "\\test" + _testCulture + ".properties";
              string stringValue = "Some Value <a href='test'>Another Value</a>" + Environment.NewLine;
              string data = "key=" + stringValue;

              string fullTempPath = Path.GetTempPath() + filePath;
              File.WriteAllBytes(fullTempPath, Encoding.UTF8.GetBytes(data));

              LocalizableMessageStorage messageStorage = new LocalizableMessageStorage(Path.GetTempPath(), FilePattern);
              File.Delete(Environment.CurrentDirectory + filePath);
              Assert.AreEqual(1, messageStorage.GetMessagesCountForLocale(_testCulture), "There should only have been one actual message in this file.");
              string trimmedValue = stringValue.TrimEnd(Environment.NewLine.ToCharArray());
              Assert.AreEqual(trimmedValue, messageStorage.GetLocalizedMessage(_testCulture, "key"));
        }
        public void TestNewLineEscape()
        {
            string filePath = "\\test" + _testCulture + ".properties";
              string stringValue = "Some Value/" + Environment.NewLine + " Another Value" + Environment.NewLine;
              string data = "key=" + stringValue;

              string fullTempPath = Path.GetTempPath() + filePath;
              File.WriteAllBytes(fullTempPath, Encoding.UTF8.GetBytes(data));

              LocalizableMessageStorage messageStorage = new LocalizableMessageStorage(Path.GetTempPath(), FilePattern);
              File.Delete(Environment.CurrentDirectory + filePath);
              Assert.AreEqual(1, messageStorage.GetMessagesCountForLocale(_testCulture), "There should only have been one actual message in this file.");
              string expectedValue = "Some Value Another Value";
              Assert.AreEqual(expectedValue, messageStorage.GetLocalizedMessage(_testCulture, "key"));
        }