Exemplo n.º 1
0
        public void GivenEventMessage_WhenAskingToSendNeed_ThenItShouldReturnEventData()
        {
            // arrange
            EventData        expected         = new EventData(Encoding.UTF8.GetBytes("{'Dammit':'Bobby!'}"));
            FakeEventMessage fakeEventMessage = new FakeEventMessage(expected);
            Need             need             = new Need(fakeEventMessage, new FakeEventHubClient());

            // act
            EventData actual = need.SendAsync().Result;

            // assert
            actual.Should().Be(expected);
        }
Exemplo n.º 2
0
        public void GivenEventMessage_WhenAskingToSendNeed_ThenItShouldCallEventHubClient()
        {
            // arrange
            EventData          expected           = new EventData(Encoding.UTF8.GetBytes("{'Dammit':'Bobby!'}"));
            FakeEventMessage   fakeEventMessage   = new FakeEventMessage(expected);
            FakeEventHubClient fakeEventHubClient = new FakeEventHubClient();
            Need need = new Need(fakeEventMessage, fakeEventHubClient);

            // act
            Func <Task> func = async() => await need.SendAsync();

            func.Invoke();

            // assert
            fakeEventHubClient.CallCount.Should().Be(1);
        }