Exemple #1
0
        public static void Generate_GivenNullSequences_ThrowsArgumentNullException()
        {
            var nameTranslator   = new VerbatimNameTranslator();
            var dbContextBuilder = new EFCoreDbContextBuilder(nameTranslator, "test");
            var tables           = Array.Empty <IRelationalDatabaseTable>();
            var views            = Array.Empty <IDatabaseView>();

            Assert.That(() => dbContextBuilder.Generate(tables, views, null), Throws.ArgumentNullException);
        }
Exemple #2
0
        public static void Generate_GivenValidSequence_ReturnsExpectedConfiguration()
        {
            var nameTranslator   = new VerbatimNameTranslator();
            var dbContextBuilder = new EFCoreDbContextBuilder(nameTranslator, "test");
            var tables           = Array.Empty <IRelationalDatabaseTable>();
            var views            = Array.Empty <IDatabaseView>();

            var sequence = new DatabaseSequence(
                "test_sequence",
                3,
                20,
                Option <decimal> .Some(0),
                Option <decimal> .Some(100),
                true,
                2
                );
            var sequences = new[] { sequence };

            var result = dbContextBuilder.Generate(tables, views, sequences);

            Assert.That(result, Is.EqualTo(ExpectedSequenceTestResult).Using(LineEndingInvariantStringComparer.Ordinal));
        }