GetSender() private method

private GetSender ( ILogger logger ) : IWebHookSender
logger ILogger
return IWebHookSender
コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }