SHARE
TWEET

date-expression

a guest Feb 22nd, 2013 41 Never
  1. [Test]
  2. public void TestFullExpression()
  3. {
  4.         string s = "13y4M23d5h10m43s";
  5.         DateExpression dp = new DateExpression( s );
  6.  
  7.         Assert.That( dp.Years, Is.EqualTo( 13 ) );
  8.         Assert.That( dp.Months, Is.EqualTo( 4 ) );
  9.         Assert.That( dp.Days, Is.EqualTo( 23 ) );
  10.         Assert.That( dp.Hours, Is.EqualTo( 5 ) );
  11.         Assert.That( dp.Minutes, Is.EqualTo( 10 ) );
  12.         Assert.That( dp.Seconds, Is.EqualTo( 43 ) );
  13. }
RAW Paste Data
Top