Пример #1
0
        public void IsOneOfShouldNotMatchInvalidList()
        {
            var message = new PlainMessage()
            {
                Type = EventType.ChannelCreated
            };

            var matches = new[]
            {
                EventType.ImClose,
                EventType.PinAdded,
                EventType.ChannelLeft,
                EventType.CommandsChanged,
                EventType.ManualPresenceChange
            };

            var result = EventMessageExtensions.IsOneOf(message, matches);

            Assert.False(result);
        }
Пример #2
0
        public void IsOneOfShouldMatchValidList()
        {
            var message = new PlainMessage()
            {
                Type = EventType.Hello
            };

            var matches = new[]
            {
                EventType.AccountsChanged,
                EventType.ChannelCreated,
                EventType.ChannelLeft,
                EventType.CommandsChanged,
                EventType.Hello
            };

            var result = EventMessageExtensions.IsOneOf(message, matches);

            Assert.True(result);

            result = EventMessageExtensions.IsOneOf(message, EventType.Hello);
            Assert.True(result);
        }