Ejemplo n.º 1
0
        public static void FormatWhenExceptionHasNotBeenThrown()
        {
            var exception = new NotSupportedException();

            using var writer = new StringWriter(CultureInfo.CurrentCulture);
            exception.Print(writer);
            var content = writer.GetStringBuilder().ToString();

            Assert.Multiple(() =>
            {
                Assert.That(content, Contains.Substring("Type Name: System.NotSupportedException"));
                Assert.That(content, Contains.Substring("Source: "));
                Assert.That(content, Does.Not.Contain("Data:"));
                Assert.That(content, Does.Not.Contain("Custom Properties:"));
            });
        }