public void OutputEncoded_NullString_OutputsEmpty()
		{
			TestableView view = new TestableView();

			string input = null;

			string expected = string.Empty;

			string actual = GetFrom(view, delegate { view.OutputEncoded(input); });

			Assert.AreEqual(expected, actual);
		}
Exemple #2
0
        public void Output_Object_OutputsToString()
        {
            var view = new TestableView();

            var input = new SillyString("<a href='ken'>egozi</a>");

            var expected = "<a href='ken'>egozi</a>";

            var actual = GetFrom(view, delegate { view.Output(input); });

            Assert.AreEqual(expected, actual);
        }
		public void Output_Object_OutputsToString()
		{
			TestableView view = new TestableView();

			SillyString input = new SillyString("<a href='ken'>egozi</a>");

			string expected = "<a href='ken'>egozi</a>";

			string actual = GetFrom(view, delegate { view.Output(input); });

			Assert.AreEqual(expected, actual);
		}
Exemple #4
0
        public void OutputEncoded_NullObject_OutputsEmpty()
        {
            var view = new TestableView();

            object input = null;

            var expected = string.Empty;

            var actual = GetFrom(view, delegate { view.OutputEncoded(input); });

            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
        public void OutputEncoded_String_OutputsTheStringEncoded()
        {
            var view = new TestableView();

            var input = "<a href='ken'>egozi</a>";

            var expected = HttpUtility.HtmlEncode(input).Replace("'", "&#39;");

            var actual = GetFrom(view, delegate { view.OutputEncoded(input); });

            Assert.AreEqual(expected, actual);
        }
Exemple #6
0
        public void Output_NullString_OutputsEmpty()
        {
            var view = new TestableView();

            string input = null;

            var expected = string.Empty;

            var actual = GetFrom(view, delegate { view.Output(input); });

            Assert.AreEqual(expected, actual);
        }
		public void Output_NullObject_OutputsEmpty()
		{
			var view = new TestableView();

			object input = null;

			var expected = string.Empty;

			var actual = GetFrom(view, delegate { view.Output(input); });

			Assert.AreEqual(expected, actual);
		}
		public void Output_String_OutputsTheString()
		{
			var view = new TestableView();

			var input = "<a href='ken'>egozi</a>";

			var expected = "<a href='ken'>egozi</a>";

			var actual = GetFrom(view, delegate { view.Output(input); });

			Assert.AreEqual(expected, actual);
		}
Exemple #9
0
        public void OutputEncoded_NullString_OutputsEmpty()
        {
            TestableView view = new TestableView();

            string input = null;

            string expected = string.Empty;

            string actual = GetFrom(view, delegate { view.OutputEncoded(input); });

            Assert.AreEqual(expected, actual);
        }
Exemple #10
0
        public void Output_String_OutputsTheString()
        {
            TestableView view = new TestableView();

            string input = "<a href='ken'>egozi</a>";

            string expected = "<a href='ken'>egozi</a>";

            string actual = GetFrom(view, delegate { view.Output(input); });

            Assert.AreEqual(expected, actual);
        }
Exemple #11
0
        public void OutputEncoded_Object_OutputsToStringEncoded()
        {
            TestableView view = new TestableView();

            SillyString input = new SillyString("<a href='ken'>egozi</a>");

            string expected = "&lt;a href=&apos;ken&apos;&gt;egozi&lt;/a&gt;";

            string actual = GetFrom(view, delegate { view.OutputEncoded(input); });

            Assert.AreEqual(expected, actual);
        }
		public void OutputEncoded_Object_OutputsToStringEncoded()
		{
			TestableView view = new TestableView();

			SillyString input = new SillyString("<a href='ken'>egozi</a>");

			string expected = "&lt;a href=&apos;ken&apos;&gt;egozi&lt;/a&gt;";

			string actual = GetFrom(view, delegate { view.OutputEncoded(input); });

			Assert.AreEqual(expected, actual);
		}
		public void OutputEncoded_Object_OutputsToStringEncoded()
		{
			var view = new TestableView();

			var input = "<a href='ken'>egozi</a>";

			var inputAsObject = new SillyString(input);

			var expected = HttpUtility.HtmlEncode(input).Replace("'", "&#39;");

			var actual = GetFrom(view, delegate { view.OutputEncoded(inputAsObject); });

			Assert.AreEqual(expected, actual);
		}
		public void OutputEncoded_String_OutputsTheStringEncoded()
		{
			TestableView view = new TestableView();

			string input = "<a href='ken'>egozi</a>";

			string expected = HttpUtility.HtmlEncode(input).Replace("'", "&#39;");

			string actual = GetFrom(view, delegate { view.OutputEncoded(input); });

			Assert.AreEqual(expected, actual);
		}