public void UpdateNotificationTemplate_Service_Fail() { // Arrange notificationTemplateService = new NotificationTemplateService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object); mockRepository.Setup(x => x.Update(It.IsAny <NotificationTemplate>())).Returns(false).Verifiable(); // Act var notificationTemplate = new NotificationTemplateDto(); var response = notificationTemplateService.UpdateNotificationTemplate(notificationTemplate); // Assert Assert.IsNotNull(response); Assert.IsFalse(response.Result); Assert.IsTrue(response.Notifications.HasErrors()); Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <bool>)); mockRepository.Verify(x => x.Update(It.IsAny <NotificationTemplate>()), Times.Once); }