Skip to content

Reuse SchemaExport in CreateSchema/DropSchema in tests #1519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 11, 2018

Conversation

bahusoid
Copy link
Member

No description provided.

hazzik
hazzik previously approved these changes Jan 10, 2018
Copy link
Member

@fredericDelaporte fredericDelaporte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new warning must be fixed in SQLiteMultiCriteriaTest.cs.

@@ -48,6 +49,8 @@ protected virtual string MappingsAssembly
get { return "NHibernate.DomainModel"; }
}

protected SchemaExport SchemaExport => _schemaExport ?? (_schemaExport = new SchemaExport(cfg));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NHSpecificTest\NH2195\SQLiteMultiCriteriaTest.cs(35,18): warning CS0108: 'SQLiteMultiCriteriaTest.SchemaExport(Configuration)' hides inherited member 'TestCase.SchemaExport'. Use the new keyword if hiding was intended.

Release build will fail. Maybe is it time to enable warning as error in the test project debug config too.

@fredericDelaporte fredericDelaporte self-assigned this Jan 10, 2018
@bahusoid
Copy link
Member Author

bahusoid commented Jan 10, 2018

Can I also push here some small modification in SchemaExport class to avoid unnecessary calls for SchemaExport.Initialize for each dropSQL/createSQL statement (private Execute method doesn't need to call Initialize)? This change doesn't worth a separate PR but I don't like useless calls in cycles :)

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Jan 10, 2018

So it would be just removing this line, because this method is called only in one other method which already calls Initialize.

Still a bit unrelated, but well why not.

@bahusoid
Copy link
Member Author

@fredericDelaporte Yeah. Also renamed it to ExecuteInitialized to differentiate it from other public Execute methods where Initialize is called.

@fredericDelaporte fredericDelaporte merged commit 881a932 into nhibernate:master Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants