Example #1
0
        public void Buy(int money)
        {
            var buyUpgrade = new BuyUpgrade(Price, Bonus, 2);

            buyUpgrade.Buy(0);
            Bonus = buyUpgrade.Bonus;
            Price = buyUpgrade.Price;
            EventsAggregator.Publish();
        }
        public void Publish_WhenSubscriberThrowsExceptionAndLoggerFactoryIsNull_UseLogger()
        {
            var target     = new EventsAggregator(_metricsReporter, _exceptionLogger);
            var subscriber = new FlawedSubscriber();

            subscriber.SubscribeForEvents(target);

            target.Publish(new DummyEvent());

            _exceptionLogger.AssertWasCalled(x => x.Error(Arg <Type> .Is.Anything, Arg <IEvent> .Is.Anything, Arg <Exception> .Is.Anything));
        }