Provides singleton instances of custom WebHook API services used by this module. If alternative implementations are provided by a Dependency Injection engine then those instances are used instead.
Beispiel #1
0
        public void GetFilterProviders_ReturnsSingletonInstance()
        {
            // Act
            IEnumerable <IWebHookRegistrar> actual1 = CustomApiServices.GetRegistrars();
            IEnumerable <IWebHookRegistrar> actual2 = CustomApiServices.GetRegistrars();

            // Assert
            Assert.Same(actual1, actual2);
        }
Beispiel #2
0
        public void GetIdValidator_ReturnsSingleInstance()
        {
            // Act
            IWebHookIdValidator actual1 = CustomApiServices.GetIdValidator();
            IWebHookIdValidator actual2 = CustomApiServices.GetIdValidator();

            // Assert
            Assert.Same(actual1, actual2);
        }
Beispiel #3
0
        public void SetIdValidator_GetIdValidator_Roundtrips()
        {
            // Arrange
            Mock <IWebHookIdValidator> idValidatorMock = new Mock <IWebHookIdValidator>();

            // Act
            CustomApiServices.SetIdValidator(idValidatorMock.Object);
            IWebHookIdValidator actual = CustomApiServices.GetIdValidator();

            // Assert
            Assert.Same(idValidatorMock.Object, actual);
        }