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 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); }