コード例 #1
0
        public void SetTemplateMethodSadPath()
        {
            var options = new TestFormattableLogProviderOptions();

            Action act = () => options.SetTemplate(null);

            act.Should().ThrowExactly <ArgumentNullException>().WithMessage("*template*");
        }
コード例 #2
0
        public void SetTemplateMethodHappyPath()
        {
            var options = new TestFormattableLogProviderOptions();

            options.SetTemplate("foo");

            var formatter = options.FormatterRegistration.Invoke(_emptyServiceProvider);

            formatter.Should().BeOfType <TemplateLogFormatter>()
            .Which.Template.Should().Be("foo");
        }