Exemplo n.º 1
0
        private void AssertDateParsing(SifFormatter formatter, String stringValue, Calendar value)
        {
            Console.WriteLine("Testing Date parse of '" + stringValue + "' using " + formatter.ToString());
            //Calendar testValue = formatter.ToDate(stringValue);
            DateTime testValue = (DateTime)formatter.ToDate(stringValue);

            Assertion.AssertEquals("Date Value", value, testValue);
            Assertion.AssertEquals("String Value", stringValue, (String)formatter.ToDateString(testValue));

            testValue = (DateTime)formatter.ToDate(null);
            Assertion.AssertNull("Date value should be null", testValue);
        }
Exemplo n.º 2
0
        public void RenderRaw(XmlWriter writer,
                              SifVersion version,
                              Element o,
                              SifFormatter formatter)
        {
            DateTime?timeStamp = ((SifDateTime)o.SifValue).Value;

            if (timeStamp.HasValue)
            {
                String xmlDate = formatter.ToDateString(timeStamp);
                WriteSimpleElement(writer, fDateElement, xmlDate);
                SIFTimeSurrogate.WriteSIFTime(writer, formatter, fTimeElement, timeStamp.Value);
            }
        }
Exemplo n.º 3
0
 public void RenderRaw( XmlWriter writer,
                        SifVersion version,
                        Element o,
                        SifFormatter formatter )
 {
     DateTime? timeStamp = ((SifDateTime) o.SifValue).Value;
     if ( timeStamp.HasValue )
     {
         String xmlDate = formatter.ToDateString( timeStamp );
         WriteSimpleElement( writer, fDateElement, xmlDate );
         SIFTimeSurrogate.WriteSIFTime( writer, formatter, fTimeElement, timeStamp.Value );
     }
 }