Exemplo n.º 1
0
		public void HtmlSimple ()
		{
			TextSyndicationContent shtml = new TextSyndicationContent (validhtml, TextSyndicationContentKind.Html);

			Assert.AreEqual (typeof (TextSyndicationContent), shtml.GetType (), "#HS1");
			Assert.AreEqual (typeof (string), shtml.Text.GetType (), "#HS2");
			// check for content and type
			Assert.AreEqual (validhtml, shtml.Text.ToString (), "#HS3");
			Assert.AreEqual (text_types [(int) TextSyndicationContentKind.Html], shtml.Type, "#HS4");
		}
Exemplo n.º 2
0
		public void TextSimple ()
		{
			TextSyndicationContent stext = new TextSyndicationContent (lorem, TextSyndicationContentKind.Plaintext);

			Assert.AreEqual (typeof (TextSyndicationContent), stext.GetType (), "#TS1");
			Assert.AreEqual (typeof (string), stext.Text.GetType (), "#TS2");
			// check for content and type
			Assert.AreEqual (lorem, stext.Text.ToString (), "#TS3");
			Assert.AreEqual (text_types [(int) TextSyndicationContentKind.Plaintext], stext.Type.ToString (), "#TS4");

			stext = new TextSyndicationContent (null);

			// Be sure .Text is null
			try
			{
				Assert.AreEqual (typeof (string), stext.Text.GetType (), "#TS6");
				Assert.Fail ("#TS7 Expected an NullReferenceException to be thrown.");
			}
			catch (NullReferenceException) {}
		}