public void Should_Replace_DbContext()
        {
            (ServiceProvider.GetRequiredService <IThirdDbContext>() is TestAppDbContext).ShouldBeTrue();

            (_dummyRepository.GetDbContext() is IThirdDbContext).ShouldBeTrue();
            (_dummyRepository.GetDbContext() is TestAppDbContext).ShouldBeTrue();
        }
Beispiel #2
0
        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);
            }
        }