Пример #1
0
        public void RegisterSameVerbDifferentCase()
        {
            MessageBus             bus        = new MessageBus();
            List <string>          output     = new List <string>();
            Action <OutputMessage> subscriber = m => output.Add(m.Text);

            bus.Subscribe(subscriber);
            TestRoom room = new TestRoom(bus);

            room.Enter();
            Action act = () => room.TestRegisterHello("HeLLO");

            act.Should().Throw <InvalidOperationException>().WithMessage("The verb 'HeLLO' is already registered.");
        }