Пример #1
0
        public void Build_ShouldCreateDbContextOptions_WithInMemoryExtension(InMemoryOptionsBuilder builder)
        {
            var actual = builder.Build(typeof(TestDbContext)).As <DbContextOptions <TestDbContext> >();

            actual.Extensions.Should().Contain(x => x.GetType() == typeof(InMemoryOptionsExtension));
        }
Пример #2
0
        public void Build_ShouldThrowArgumentNullException_WhenTypeIsNull(InMemoryOptionsBuilder builder)
        {
            Action action = () => builder.Build(null);

            action.Should().Throw <ArgumentNullException>();
        }
Пример #3
0
        public void Build_ShouldThrowArgumentNullException_WhenTypeIsAbstract(InMemoryOptionsBuilder builder)
        {
            Action action = () => builder.Build(typeof(AbstractDbContext));

            action.Should().Throw <ArgumentException>();
        }
Пример #4
0
        public void Build_ShouldBuildDbContextOptionsInstance(InMemoryOptionsBuilder builder)
        {
            var options = builder.Build(typeof(TestDbContext));

            options.Should().BeOfType <DbContextOptions <TestDbContext> >();
        }