This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

date-expression

By: a guest on Feb 22nd, 2013  |  syntax: C#  |  size: 0.39 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data