Beispiel #1
0
        public void CreateBuilderForKnownEvent()
        {
            // arrange //
            IEvent e = new AddDataEvent();
            IMessageBuilderFactory builderFactory = new MessageBuilderFactory();

            // act //
            var builder = builderFactory.GetMessageBuilder(e);

            // assert // Сравниваем по типу
            Assert.Equal(typeof(AddDataMessageBuilder), builder.GetType());
        }
Beispiel #2
0
        public void CreateBuilderForUnknownEvent()
        {
            // arrange //
            IEvent e = new FakeEvent();
            IMessageBuilderFactory builderFactory = new MessageBuilderFactory();

            // act //
            var builder = builderFactory.GetMessageBuilder(e);

            // assert // Проверрка на null
            Assert.Null(builder);
            // Assert.NotNull(builder);
        }