GetLineDelimiter() public method

Get the line delimiter for the first line.
Get the line delimiter for the first line.
public GetLineDelimiter ( ) : string
return string
Esempio n. 1
0
        public virtual void LineDelimiterStartingWithCharacterReturn()
        {
            var rt = new RawText(Constants.EncodeASCII("\nfoo"));

            NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
        }
Esempio n. 2
0
        public virtual void TestLineDelimiter()
        {
            RawText rt = new RawText(Constants.EncodeASCII("foo\n"));

            NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo\r\n"));
            NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo\nbar"));
            NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo\r\nbar"));
            NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo\nbar\r\n"));
            NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo\r\nbar\n"));
            NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("foo"));
            NUnit.Framework.Assert.IsNull(rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII(string.Empty));
            NUnit.Framework.Assert.IsNull(rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("\n"));
            NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
            rt = new RawText(Constants.EncodeASCII("\r\n"));
            NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
            NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
        }
Esempio n. 3
0
 public virtual void LineDelimiterStartingWithCharacterReturn()
 {
     var rt = new RawText(Constants.EncodeASCII("\nfoo"));
     NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
 }
Esempio n. 4
0
 public virtual void TestLineDelimiter()
 {
     RawText rt = new RawText(Constants.EncodeASCII("foo\n"));
     NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo\r\n"));
     NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo\nbar"));
     NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo\r\nbar"));
     NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo\nbar\r\n"));
     NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo\r\nbar\n"));
     NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("foo"));
     NUnit.Framework.Assert.IsNull(rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII(string.Empty));
     NUnit.Framework.Assert.IsNull(rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsTrue(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("\n"));
     NUnit.Framework.Assert.AreEqual("\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
     rt = new RawText(Constants.EncodeASCII("\r\n"));
     NUnit.Framework.Assert.AreEqual("\r\n", rt.GetLineDelimiter());
     NUnit.Framework.Assert.IsFalse(rt.IsMissingNewlineAtEnd());
 }