コード例 #1
0
 private void SetupContext(TestingContext context)
 {
     context.AddPrincipalMock();
     context.AddBinaryServiceMock();
     context.AddInMemoryDb();
     context.AddLogServiceMock();
     context.AddCacheService();
 }
コード例 #2
0
 private void InitContext(TestingContext context)
 {
     context.AddPrincipalMock();
     context.AddInMemoryDb();
     context.AddMockLogService();
     context.AddGermanCultureServiceMock();
     context.AddBinaryServiceMock();
     context.AddCacheService();
     context.DependencyMap[typeof(ICommentsService)] = context.GetService <CommentsService>();
     context.DependencyMap[typeof(ITagService)]      = context.GetService <TagService>();
 }
コード例 #3
0
        private void SetUpTestingContext(TestingContext testingContext)
        {
            testingContext.AddPrincipalMock();
            testingContext.AddInMemoryDb();
            testingContext.AddUserService();
            testingContext.AddBusinessSecurityService();
            testingContext.AddLogServiceMock();
            testingContext.AddGermanCultureServiceMock();
            testingContext.AddBinaryServiceMock();
            testingContext.AddInfoTextServiceMock();
            testingContext.AddCacheService();
            testingContext.DependencyMap[typeof(ICommentsService)] = testingContext.GetService <CommentsService>();
            testingContext.DependencyMap[typeof(ITagService)]      = testingContext.GetService <TagService>();



            Mock <INotificationService> notificationMock = new Mock <INotificationService>(MockBehavior.Loose);

            notificationMock.Setup(x => x.SendNotificationAboutQuestionAsync(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>()))
            .Returns(Task.CompletedTask);

            testingContext.DependencyMap[typeof(INotificationService)] = notificationMock.Object;
        }