StringWriter with an event that is fired on text changes.
Fake output writer. does not really write xhtml .... to be done ... later
Inheritance: System.IO.StringWriter
Ejemplo n.º 1
0
        public void PropertyLambdaFormatterNormalBehavior()
        {
            // Test read access of 'LambdaFormatter' Property.
            var actual = testObject.LambdaFormatter;
            Assert.IsNotNull(actual);

            // Test write access of 'LambdaFormatter' Property.
            var expected = new XhtmlWriter();
            testObject.LambdaFormatter = expected;
            actual = testObject.LambdaFormatter;
            Assert.AreSame(expected, actual);
        }
Ejemplo n.º 2
0
        public void EventTextChangedAddAndRemove()
        {
            string eventText = string.Empty;
            Action<object, TextWrittenEventArgs> body = (o, e) => eventText += e.Text;

            var formatter = new XhtmlWriter();
            Server.Default.LambdaFormatter = formatter;
            testObject.TextChanged += new EventHandler<TextWrittenEventArgs>(body);
            var text = "Buh";
            var expected = text + formatter.NewLine;
            formatter.WriteLine(text);
            Assert.AreEqual(expected, eventText);

            testObject.TextChanged -= new EventHandler<TextWrittenEventArgs>(body);
            formatter.WriteLine(text);
            Assert.AreEqual(expected, eventText);
        }
Ejemplo n.º 3
0
 public void TearDown()
 {
     this.testObject = null;
 }
Ejemplo n.º 4
0
 public void Construct()
 {
     this.testObject = new XhtmlWriter();
 }
Ejemplo n.º 5
0
 public void SetUp()
 {
     this.testObject = new XhtmlWriter();
     this.eventText = string.Empty;
 }