Exemplo n.º 1
0
        public void GetHubByName_ChannelName_FindsChannelWithMatchingName()
        {
            var expectedChannel = new Channel {
                Id = "C1", Name = "foo"
            };
            var otherChannel = new Channel {
                Id = "C2", Name = "bar"
            };

            _api.Channels.List().Returns(new[] { otherChannel, expectedChannel });

            _sut.GetHubByName("#foo")
            .ShouldComplete()
            .And.ShouldBe(expectedChannel);
        }
Exemplo n.º 2
0
        public void GetHubByName_ChannelName_FindsChannelWithMatchingName()
        {
            var expectedChannel = new Conversation {
                Id = "C1", Name = "foo", IsChannel = true
            };
            var otherChannel = new Conversation {
                Id = "C2", Name = "bar", IsChannel = true
            };

            _api.Conversations.List(types: IsOfAllConversationTypes()).Returns(ConversationList(otherChannel, expectedChannel));

            _sut.GetHubByName("#foo")
            .ShouldComplete()
            .And.ShouldBeA <Channel>()
            .And.Name.ShouldBe(expectedChannel.Name);
        }