protected override void DoSetUp() { SomeDisposableSingleton.Reset(); SomeDisposableHandler.Reset(); Console.WriteLine("Running setup for {0}", typeof(TFactory)); factory = new TFactory(); adapter = factory.Create(); RebusLoggerFactory.Current = new ConsoleLoggerFactory(false); }
public void BusIsDisposedWhenContainerIsDisposed() { // arrange var disposableBus = new SomeDisposableSingleton(); SomeDisposableSingleton.Disposed.ShouldBe(false); adapter.SaveBusInstances(disposableBus); // act factory.DisposeInnerContainer(); // assert SomeDisposableSingleton.Disposed.ShouldBe(true); }