예제 #1
0
        public void CTimeToNetFormatConverter_Constructor_SetsDefaultValues()
        {
            CTimeToNetFormatConverter converter = new CTimeToNetFormatConverter();

            Assert.IsFalse(converter.IsMarker);
            Assert.IsFalse(converter.IsQuote);
        }
예제 #2
0
 public void CTimeToNetFormatConverter_ConvertCTimeToNet_VariousFormats()
 {
     Assert.AreEqual("", CTimeToNetFormatConverter.ConvertCTimeToNet("", NetDateTimeFormat.ParseFormat));
     Assert.AreEqual(" ", CTimeToNetFormatConverter.ConvertCTimeToNet(" ", NetDateTimeFormat.ParseFormat));
     Assert.AreEqual("'no marker string'", CTimeToNetFormatConverter.ConvertCTimeToNet("no marker string", NetDateTimeFormat.ParseFormat));
     Assert.AreEqual("yyyyyyMMMMdHHmmsshhttdddd", CTimeToNetFormatConverter.ConvertCTimeToNet("%Y%y%m%b%d%H%M%S%I%p%A", NetDateTimeFormat.ParseFormat));
     Assert.AreEqual("yyyyyyMMMMMddHHmmsshhttdddd", CTimeToNetFormatConverter.ConvertCTimeToNet("%Y%y%m%b%d%H%M%S%I%p%A", NetDateTimeFormat.PrintFormat));
     Assert.AreEqual("'Today is 'yyyy' 'dd' - 'MM", CTimeToNetFormatConverter.ConvertCTimeToNet("Today is %Y %d - %m", NetDateTimeFormat.PrintFormat));
 }
예제 #3
0
        public void CTimeToNetFormatConverter_OpenQuotes_AddsQuoteIfNotInQuotes()
        {
            CTimeToNetFormatConverter converter = new CTimeToNetFormatConverter();

            Assert.IsFalse(converter.IsQuote);
            converter.OpenQuotes();
            Assert.IsTrue(converter.IsQuote);
            Assert.AreEqual("'", converter.ToString());
        }
예제 #4
0
        public void CTimeToNetFormatConverter_CloseQuotes_AddsQuoteIfInQuotes()
        {
            CTimeToNetFormatConverter converter = new CTimeToNetFormatConverter();

            converter.OpenQuotes();

            converter.CloseQuotes();
            Assert.False(converter.IsQuote);
            Assert.Equal("''", converter.ToString());
        }
예제 #5
0
        public void CTimeToNetFormatConverter_OpenQuotes_AddsNothingIfInQuotes()
        {
            CTimeToNetFormatConverter converter = new CTimeToNetFormatConverter();

            converter.OpenQuotes();

            converter.OpenQuotes();
            Assert.True(converter.IsQuote);
            Assert.Equal("'", converter.ToString());
        }
예제 #6
0
 public void CTimeToNetFormatConverter_ConvertCTimeToNet_HandlesDoubleMarkerAsSingleChar()
 {
     Assert.AreEqual("'%'", CTimeToNetFormatConverter.ConvertCTimeToNet("%%", NetDateTimeFormat.ParseFormat));
     Assert.AreEqual("'%'", CTimeToNetFormatConverter.ConvertCTimeToNet("%%", NetDateTimeFormat.PrintFormat));
 }