Exemple #1
0
        public static void Ctor_GivenTriggersWithNullValue_ThrowsArgumentNullException()
        {
            Identifier tableName  = "test_table";
            var        columns    = new[] { Mock.Of <IDatabaseColumn>() };
            var        primaryKey = Option <IDatabaseKey> .None;
            var        uniqueKeys = Array.Empty <IDatabaseKey>();
            var        parentKeys = Array.Empty <IDatabaseRelationalKey>();
            var        childKeys  = Array.Empty <IDatabaseRelationalKey>();
            var        indexes    = Array.Empty <IDatabaseIndex>();
            var        checks     = Array.Empty <IDatabaseCheckConstraint>();
            var        triggers   = new IDatabaseTrigger[] { null };

            Assert.That(() => new RelationalDatabaseTable(tableName, columns, primaryKey, uniqueKeys, parentKeys, childKeys, indexes, checks, triggers), Throws.ArgumentNullException);
        }
        public Trigger Map(Identifier tableName, IDatabaseTrigger trigger)
        {
            if (tableName == null)
            {
                throw new ArgumentNullException(nameof(tableName));
            }
            if (trigger == null)
            {
                throw new ArgumentNullException(nameof(trigger));
            }

            return(new Trigger(
                       tableName,
                       trigger.Name,
                       string.Empty,
                       trigger.Definition,
                       trigger.QueryTiming,
                       trigger.TriggerEvent
                       ));
        }