Beispiel #1
0
 public void GetSchemaReport(Output output, bool verbose = false)
 {
     lock (_lock)
     {
         ConfigureCollection();
         _collection.GetSchemaReport(output, verbose);
     }
 }
Beispiel #2
0
        public void TableDefinitionsAreLoadedFromType()
        {
            //Arrange/Act
            var snapshots = new SnapshotCollection(GetType());

            //Assert
            var output = new Output();

            snapshots.GetSchemaReport(output);
            output.Report.Verify();
        }
Beispiel #3
0
        public void TableDefinitionsAreFilteredLoadedFromAssembly()
        {
            //Arrange/Act
            var snapshots = new SnapshotCollection(GetType().Assembly, t => t != typeof(Snapshots.TestDefinitions.TableDef));

            //Assert
            var output = new Output();

            snapshots.GetSchemaReport(output);
            output.Report.Verify();
        }
Beispiel #4
0
        public void BasicTableStructureIsLoaded()
        {
            //Arrange
            var collection = new SnapshotCollection();

            //Act
            SnapshotTableDefiner.Define(collection, _schema);

            //Assert
            var output = new Output();

            collection.GetSchemaReport(output, true);
            output.Report.Verify();
        }
Beispiel #5
0
        public void TablesAreDefined()
        {
            //Arrange
            var snapshots = new SnapshotCollection();

            //Act
            snapshots.DefineTable("Customer").PrimaryKey("Id").CompareKey("Surname");
            snapshots.DefineTable("Address").PrimaryKey("AddressId");

            //Assert
            var output = new Output();

            snapshots.GetSchemaReport(output);
            output.Report.Verify();
        }
Beispiel #6
0
        public void TableDefinitionsCanBeApplied()
        {
            //Arrange
            var definitionSet = SnapshotDefinitionLoader.Load(GetType());
            var snapshots     = new SnapshotCollection();

            //Act
            snapshots.ApplyDefinitions(definitionSet);

            //Assert
            var output = new Output();

            snapshots.GetSchemaReport(output, true);
            output.Report.Verify();
        }
Beispiel #7
0
        public void AppliedDefinitionsAreMerged()
        {
            //Arrange
            var definitionSet = SnapshotDefinitionLoader.Load(GetType());
            var snapshots     = new SnapshotCollection();

            snapshots.DefineTable("LocalTable").CompareKey("Name");

            //Act
            snapshots.ApplyDefinitions(definitionSet);

            //Assert
            var output = new Output();

            snapshots.GetSchemaReport(output, true);
            output.Report.Verify();
        }
        public void TablesCanBeAutomaticallyDefined()
        {
            //Arrange
            var data = new[]
            {
                new { A = 1, B = "Bee", C = 5.5 },
                new { A = 2, B = "Cee", C = 6.6 },
                new { A = 3, B = "Dee", C = 7.7 },
                new { A = 4, B = "Eee", C = 8.8 },
                new { A = 5, B = "Eff", C = 9.9 },
            };

            var snapshot = _collection.NewSnapshot("Test");

            //Act
            data.ToSnapshotTable(snapshot, "Data", "A", "B");

            //Assert
            var output = new Output();
            var table  = _collection.GetTableDefinition("Data");

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