GetStore() public static method

Gets a default IWebHookStore implementation which is used if none are registered with the Dependency Injection engine.
public static GetStore ( ) : IWebHookStore
return IWebHookStore
        public void GetStore_ReturnsSingleInstance()
        {
            // Act
            IWebHookStore actual1 = CustomServices.GetStore();
            IWebHookStore actual2 = CustomServices.GetStore();

            // Assert
            Assert.Same(actual1, actual2);
        }
        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);
        }
Esempio n. 3
0
        public void GetManager_ReturnsSingleInstance()
        {
            // Arrange
            ILogger       logger = CommonServices.GetLogger();
            IWebHookStore store  = CustomServices.GetStore();

            // Act
            IWebHookManager actual1 = CustomServices.GetManager(store, logger);
            IWebHookManager actual2 = CustomServices.GetManager(store, logger);

            // Assert
            Assert.Same(actual1, actual2);
        }