コード例 #1
0
        public void Should_Replace_DbContext()
        {
            (ServiceProvider.GetRequiredService <IThirdDbContext>() is TestAppDbContext).ShouldBeTrue();

            (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue();
            (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue();
        }
コード例 #2
0
ファイル: DbContext_Replace_Tests.cs プロジェクト: zxbe/abp
        public async Task Should_Replace_DbContext()
        {
            (ServiceProvider.GetRequiredService <IThirdDbContext>() is TestAppDbContext).ShouldBeTrue();

            using (_unitOfWorkManager.Begin())
            {
                (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue();
                (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue();

                await _unitOfWorkManager.Current.CompleteAsync().ConfigureAwait(false);
            }
        }