Beispiel #1
0
        private void SetUpTestingContext(TestingContext testingContext)
        {
            testingContext.AddPrincipalMock();
            testingContext.AddBinaryServiceMock();
            testingContext.AddLogServiceMock();
            testingContext.AddCranAppSettings();
            testingContext.AddInfoTextServiceMock();
            testingContext.AddInMemoryDb();
            testingContext.AddUserService();

            Mock <IWebPushClient> webPushClientMock = new Mock <IWebPushClient>(MockBehavior.Loose);

            webPushClientMock.Setup(x => x.SendNotificationAsync(It.IsAny <PushSubscription>(),
                                                                 It.IsAny <string>(), It.IsAny <VapidDetails>()))
            .Returns(Task.CompletedTask);

            testingContext.DependencyMap[typeof(IWebPushClient)] = webPushClientMock.Object;
        }