public static SqlSnapshotCollection MakeCollection()
        {
            var collection = new SqlSnapshotCollection(Config.ConnectionString);

            collection.ConfigureSchema("Chess"); //this loads table definitions direct from the database schema. In theory no further config should be required
            collection.LoadSchemaOverrides(typeof(SchemaObjectMother).Assembly);

            //In practice, however, some extra configuration settings are needed
            return(collection);
        }
Пример #2
0
        public void SchemaOverridesCannotBeLoadedFromAssemblyAfterSnapshot()
        {
            //Arrange
            var collection = new SqlSnapshotCollection(DbController.ConnectionString);

            collection.ConfigureSchema("Test");
            collection.Snapshot("Test");

            //Act
            Action action = () => collection.LoadSchemaOverrides(GetType().Assembly);

            //Assert
            action.Should().Throw <ConfigurationCannotBeChangedException>();
        }
Пример #3
0
        public void SchemaOverridesCanBeLoadedFromAssembly()
        {
            //Arrange
            var collection = new SqlSnapshotCollection(DbController.ConnectionString);

            collection.ConfigureSchema("Test");

            //Act
            collection.LoadSchemaOverrides(GetType().Assembly);

            //Assert
            var output = new Output();

            collection.GetSchemaReport(output, true);
            output.Report.Verify();
        }