Example #1
0
        public void EventGridServiceIsValidEventGridPublishClientOptionsRaisesExceptionWhenNullEventGridPublishClientOptions()
        {
            // arrange

            // act
            var exceptionResult = Assert.Throws <ArgumentNullException>(() => EventGridService.IsValidEventGridPublishClientOptions(fakeLogger, null));

            // assert
            A.CallTo(() => fakeEventGridClientService.SendEventAsync(A <List <EventGridEvent> > .Ignored, A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
            Assert.Equal("Value cannot be null. (Parameter 'eventGridPublishClientOptions')", exceptionResult.Message);
        }
Example #2
0
        public void EventGridServiceIsValidEventGridPublishClientOptionsReturnsSuccess()
        {
            // arrange
            const bool expectedResult = true;

            // act
            var result = EventGridService.IsValidEventGridPublishClientOptions(fakeLogger, eventGridPublishClientOptions);

            // assert
            Assert.Equal(expectedResult, result);
        }
Example #3
0
        public void EventGridServiceIsValidEventGridPublishClientOptionsReturnsFalseWhenNullApiEndpoint()
        {
            // arrange
            const bool expectedResult = false;

            eventGridPublishClientOptions.ApiEndpoint = null;

            // act
            var result = EventGridService.IsValidEventGridPublishClientOptions(fakeLogger, eventGridPublishClientOptions);

            // assert
            Assert.Equal(expectedResult, result);
        }
Example #4
0
        public void EventGridServiceIsValidEventGridPublishClientOptionsReturnsFalseWhenNullSubjectPrefix()
        {
            // arrange
            const bool expectedResult = false;

            eventGridPublishClientOptions.SubjectPrefix = string.Empty;

            // act
            var result = EventGridService.IsValidEventGridPublishClientOptions(fakeLogger, eventGridPublishClientOptions);

            // assert
            Assert.Equal(expectedResult, result);
        }