public void SetFormatterMethod1SadPath() { var options = new TestFormattableLogProviderOptions(); Action act = () => options.SetFormatter(null); act.Should().ThrowExactly <ArgumentNullException>().WithMessage("*formatter*"); }
public void SetFormatterMethod2HappyPath() { var options = new TestFormattableLogProviderOptions(); options.SetFormatter <TestLogFormatter>(123); var formatter = options.FormatterRegistration.Invoke(_emptyServiceProvider); formatter.Should().BeOfType <TestLogFormatter>() .Which.Foo.Should().Be(123); }
public void SetFormatterMethod1HappyPath() { var formatter = new Mock <ILogFormatter>().Object; var options = new TestFormattableLogProviderOptions(); options.SetFormatter(formatter); var actualFormatter = options.FormatterRegistration.Invoke(_emptyServiceProvider); actualFormatter.Should().BeSameAs(formatter); }