public void Test11CompareAllPartsWithFinishOk() { //SETUP var comparer = new CompareEfSql(); ISuccessOrErrors status; //EXECUTE using (var db = new TestEf6DataTypesDb()) { comparer.CompareEfPartStart(db); status = comparer.CompareEfPartWithDb <DataTop>(db); } using (var db = new TestEf6ComplexDb()) { status.Combine(comparer.CompareEfPartWithDb <DataTop>(db)); } using (var db = new TestEf6PublicPrivateDb()) { status.Combine(comparer.CompareEfPartWithDb <DataTop>(db)); } using (var db = new TestEf6RelationshipsDb()) { status.Combine(comparer.CompareEfPartWithDb <DataTop>(db)); } status.Combine(comparer.CompareEfPartFinalChecks()); //VERIFY status.ShouldBeValid(); status.Warnings.Count.ShouldEqual(0, string.Join("\n", status.Warnings)); }
public void Test04CompareEfPartRelationshipsDbOk() { using (var db = new TestEf6RelationshipsDb()) { //SETUP var comparer = new CompareEfSql(); //EXECUTE comparer.CompareEfPartStart(db); var status = comparer.CompareEfPartWithDb <DataTop>(db); //VERIFY status.ShouldBeValid(); status.Warnings.Count.ShouldEqual(0, string.Join("\n", status.Warnings)); } }
public void Test45CompareEfPartCompareSameDbTwiceBad() { using (var db = new TestEf6PublicPrivateDb()) { //SETUP var comparer = new CompareEfSql(); comparer.CompareEfPartStart(db); //EXECUTE comparer.CompareEfPartWithDb <DataTop>(db).ShouldBeValid(); var status = comparer.CompareEfPartWithDb <DataTop>(db); //second time should fail as publicPrivate already used //VERIFY status.ShouldBeValid(false); status.GetAllErrors().ShouldEqual("Missing Table: The SQL database does not contain a table called [dbo].[DataPublicPrivate]. Needed by EF class DataPublicPrivate."); } }
public void Test40CompareEfPartFinishHasMissingTablesBad() { using (var db = new TestEf6DataTypesDb()) { //SETUP var comparer = new CompareEfSql(); comparer.CompareEfPartStart(db); comparer.CompareEfPartWithDb <DataTop>(db).ShouldBeValid(); //EXECUTE var status = comparer.CompareEfPartFinalChecks(); //VERIFY status.ShouldBeValid(); status.HasWarnings.ShouldEqual(true); } }