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
Refactor generator tests #416
Merged
daniellee
merged 12 commits into
fluentmigrator:master
from
matthewdunsdon:RefactorGeneratorTests
May 26, 2013
Merged
Refactor generator tests #416
daniellee
merged 12 commits into
fluentmigrator:master
from
matthewdunsdon:RefactorGeneratorTests
May 26, 2013
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please let me know if you need any help with merging changes. If I think it is appropriate, I will try to rebase my changes on to any other changes that get made on master, but this can take a fair amount of time to do. |
Great work again, Matthew! How long did this take you? It looks like you added more than 600 tests for the generator classes! 🌟 🌟 🌟 |
@matthewdunsdon Cheers mate, amazing work :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing unit tests for 'generators' share a common set of test cases, but since there is minimal amount base test classes, there are generators that are missing tests. This code is an attempt to resolve this by improving base test classes.
The goals are
<Generator>ColumnTests.cs
<Generator>DataTests.cs
<Generator>TableTests.cs
Scope
The scope behind this work is to add the tests that describe the current behaviour of the system. I have not verified whether the output given by each test is the intended behaviour, nor have I tried to run any of outputs of these unit tests on an actual database.
It is my expectation that as people encounter problems and review these new tests, they will correct any incorrect assumptions in the tests and update the rest of the application to make the test pass.
Notes
The first point to note is that these code will introduce challenges around merging generator unit test changes that others make. I have invested to try to make this job as painless as possible but this issue will still be there.
Secondly, I have introduced a new folder to cover the use of an alternative Oracle quoter. It is my understanding that a test should only have one assertion, so that it is easy to diagnose what went wrong, so this was the solution I was lead to.
Finally, a significant subset of the tests I have added are checking how functionality works when the default and a custom schema is used. Although a lot of these tests seem to be almost identical for some generators, which was done to make sure I could have simpler base classes, there are benefits to this. The main benefit is that these test document that some generators will not handle schema and will allow us to capture any mistakes that get made around schemas code changes in the rest of the application