Ejemplo n.º 1
0
        public void OnStackTraceChanged()
        {
            string trace_1 =
                "à System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\r\n" +
                "à System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n" +
                "à System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\r\n" +
                "à NUnit.UiException.Tests.MockHelper.Two_Mocks_In_Dictionary() dans C:\\folder\\file1.cs:ligne 87\r\n";

            string  trace_2 = "";
            TextBox content = _traceDisplay.Content as TextBox;

            _traceDisplay.OnStackTraceChanged(trace_1);
            Assert.That(content.Text, Is.EqualTo(trace_1));

            _traceDisplay.OnStackTraceChanged(trace_2);
            Assert.That(content.Text, Is.EqualTo(trace_2));

            // passing null should not cause error

            _traceDisplay.OnStackTraceChanged(null);
            Assert.That(content.Text, Is.EqualTo(""));

            return;
        }