Esempio n. 1
0
    public void CanCustomizeTheName()
    {
        var activator = new BuiltinHandlerActivator();

        Using(activator);

        Configure.With(activator)
        .Logging(l => l.Use(_listLoggerFactory))
        .Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "whatever"))
        .Options(o => o.SetBusName("DefaultBus"))
        .Start();

        CleanUpDisposables();

        var lines = _listLoggerFactory.ToList();

        Console.WriteLine(string.Join(Environment.NewLine, lines));

        var startLine = lines.FirstOrDefault(line => line.ToString().Contains(@"Bus ""DefaultBus"" started"))
                        ?? throw new AssertionException(@"Could not find log line containg the text 'Bus ""DefaultBus"" started'");

        Assert.That(startLine.ToString(), Contains.Substring(@"Bus ""DefaultBus"" started"));
    }