Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 28th, 2012  |  syntax: None  |  size: 1.21 KB  |  views: 16  |  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 CleanAllPostEntries_DecodeHTML_DecodeWasSuccessful()
  3.     {
  4.         // Arrange
  5.  
  6.         // Act
  7.         IEnumerable<Entry> posts = PostCRUD.GetAllPosts();
  8.  
  9.         foreach (Entry post in posts)
  10.         {
  11.             post.Title = WebUtility.HtmlDecode(post.Title);
  12.             post.Body = WebUtility.HtmlDecode(post.Body);
  13.             post.MetaTitle = WebUtility.HtmlDecode(post.MetaTitle);
  14.  
  15.             PostCRUD.UpdatePost(post);
  16.  
  17.             //System.Diagnostics.Debug.WriteLine("id: " + post.Id);
  18.             //System.Diagnostics.Debug.WriteLine("title: " + WebUtility.HtmlDecode(post.Title));
  19.             //System.Diagnostics.Debug.WriteLine("body: " + WebUtility.HtmlDecode(post.Body));
  20.         }
  21.  
  22.         //Assert
  23.         // TODO: add asserts
  24.     }
  25.        
  26. private string SamplePropery {get; set;}
  27. private string FormatMethod(string value) {}
  28.  
  29. private void SampleExecute()
  30. {
  31.     // format and set to property
  32.     SampleProperty = FormatMethod("hello world");
  33.  
  34.     // get property and format the value
  35.     string _value = FormatMethod(SampleProperty);
  36. }
  37.        
  38. private string _Item;
  39.  
  40. public string Item
  41. {
  42.     get
  43.     {
  44.         return _Item;
  45.     }
  46.     set
  47.     {
  48.         _Item = WebUtility.HtmlDecode(value);
  49.     }
  50. }