public void GivenConnectionIdInMessage_WhenAskingForClientIdentifier_ThenItShouldReturnCorrectValue()
        {
            // arrange
            const string      expected         = "connection-id";
            ITopicNeedMessage topicNeedMessage = new TopicNeedMessage(expected, "id", "topic", "need");

            // act
            string actual = topicNeedMessage.ClientIdentifier();

            // assert
            actual.Should().Be(expected);
        }
示例#2
0
        public static async Task Run(
            [ServiceBusTrigger("result", Connection = "ServiceBusConnectionString")] string message,
            [SignalR(HubName = "googazon")] IAsyncCollector <SignalRMessage> signalRMessages)
        {
            TopicNeedMessage messageObject = JsonConvert.DeserializeObject <TopicNeedMessage>(message);

            await signalRMessages.AddAsync(
                new SignalRMessage
            {
                ConnectionId = messageObject.ClientIdentifier(),
                Target       = "customerServiceNeed",
                Arguments    = new object[] { message }
            });
        }