コード例 #1
0
        private ITestDriveService GetService(ApplicationDbContext dbContext, string userId)
        {
            var mockedUserManager = CommonGetMockMethods.GetUserManager();

            CommonSetupMockMethods.SetupMockedUserManagerGetUserId(mockedUserManager, userId);
            var service = this.GetService(dbContext, mockedUserManager.Object);

            return(service);
        }
コード例 #2
0
        private async Task CallScheduleTestDriveAsync(
            ScheduleTestDriveServiceModel model,
            ApplicationDbContext dbContext,
            string userId)
        {
            SeedStatusesMethods.SeedStatus(dbContext, TestDriveStatus.Upcoming);
            var mockedUserManager = CommonGetMockMethods.GetUserManager();

            CommonSetupMockMethods.SetupMockedUserManagerGetUserId(mockedUserManager, userId);
            var service = this.GetService(dbContext, mockedUserManager.Object);
            var user    = new Mock <ClaimsPrincipal>().Object;

            await service.ScheduleTestDriveAsync(model, user);
        }