Provides singleton instances of custom WebHook services such as a default IWebHookStore implementation, IWebHookManager etc. If alternative implementations are provided by a Dependency Injection engine then those instances are used instead.
        public void GetFilterProviders_ReturnsSingletonInstance()
        {
            // Act
            IEnumerable <IWebHookFilterProvider> actual1 = CustomServices.GetFilterProviders();
            IEnumerable <IWebHookFilterProvider> actual2 = CustomServices.GetFilterProviders();

            // Assert
            Assert.Same(actual1, actual2);
        }
        public void GetUser_ReturnsSingleInstance()
        {
            // Act
            IWebHookUser actual1 = CustomServices.GetUser();
            IWebHookUser actual2 = CustomServices.GetUser();

            // Assert
            Assert.Same(actual1, actual2);
        }
        public void GetSender_ReturnsSingleInstance()
        {
            // Arrange
            ILogger logger = CommonServices.GetLogger();

            // Act
            IWebHookSender actual1 = CustomServices.GetSender(logger);
            IWebHookSender actual2 = CustomServices.GetSender(logger);

            // Assert
            Assert.Same(actual1, actual2);
        }
        public void GetFilterManager_ReturnsSingletonInstance()
        {
            // Arrange
            List <IWebHookFilterProvider> providers = new List <IWebHookFilterProvider>();

            // Act
            IWebHookFilterManager actual1 = CustomServices.GetFilterManager(providers);
            IWebHookFilterManager actual2 = CustomServices.GetFilterManager(providers);

            // Assert
            Assert.Same(actual1, actual2);
        }
        public void SetUser_GetUser_Roundtrips()
        {
            // Arrange
            Mock <IWebHookUser> userMock = new Mock <IWebHookUser>();

            // Act
            CustomServices.SetUser(userMock.Object);
            IWebHookUser actual = CustomServices.GetUser();

            // Assert
            Assert.Same(userMock.Object, actual);
        }
        public void SetStore_GetStore_Roundtrips()
        {
            // Arrange
            Mock <IWebHookStore> storeMock = new Mock <IWebHookStore>();

            // Act
            CustomServices.SetStore(storeMock.Object);
            IWebHookStore actual = CustomServices.GetStore();

            // Assert
            Assert.Same(storeMock.Object, actual);
        }
        public void SetSender_GetSender_Roundtrips()
        {
            // Arrange
            ILogger logger = CommonServices.GetLogger();
            Mock <IWebHookSender> senderMock = new Mock <IWebHookSender>();

            // Act
            CustomServices.SetSender(senderMock.Object);
            IWebHookSender actual = CustomServices.GetSender(logger);

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