コード例 #1
0
            public GetApprenticeshipHandlerTestsFixture()
            {
                _autoFixture = new Fixture();

                AccountLegalEntityId = _autoFixture.Create <long>();

                AuthenticationService = new Mock <IAuthenticationService>();
                AuthenticationService.Setup(x => x.GetUserParty()).Returns(Party.Employer);

                _db = new ProviderCommitmentsDbContext(new DbContextOptionsBuilder <ProviderCommitmentsDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options);
                SeedData();

                _query = new GetApprenticeshipQuery(ApprenticeshipId);

                _handler = new GetApprenticeshipQueryHandler(new Lazy <ProviderCommitmentsDbContext>(() => _db),
                                                             AuthenticationService.Object);
            }
コード例 #2
0
        public void SetUp()
        {
            _mockApprenticeshipRespository = new Mock <IApprenticeshipRepository>();
            _handler = new GetApprenticeshipQueryHandler(_mockApprenticeshipRespository.Object, new GetApprenticeshipValidator());

            var dataFixture = new Fixture();

            _fakeRepositoryApprenticeship = dataFixture.Build <Apprenticeship>().Create();

            _exampleValidRequest = new GetApprenticeshipRequest
            {
                Caller = new Caller
                {
                    CallerType = CallerType.Employer,
                    Id         = _fakeRepositoryApprenticeship.EmployerAccountId
                },
                ApprenticeshipId = _fakeRepositoryApprenticeship.Id
            };
        }