Esempio n. 1
0
		public void ShouldPushInfoToSubscriber()
		{
			var log = new PubSubLogger();
			var target = Substitute.For<ILogger>();

			log.RegisterSubscriber(target);

			log.Info("LOL");

			target.Received().Info("LOL");
		}
Esempio n. 2
0
		public void ShouldNotPushInfoToSubscriber_WhenTransactionInScope()
		{
			var log = new PubSubLogger();
			var target = Substitute.For<ILogger>();

			log.RegisterSubscriber(target);

			using (new LogTransaction(log))
			{
				log.Info("LOL");
				target.DidNotReceive().Info("LOL");
			}

			target.Received().Info("LOL");
		}