Navigation Menu

Skip to content
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
merged 12 commits into from May 26, 2013
Merged

Refactor generator tests #416

merged 12 commits into from May 26, 2013

Conversation

matthewdunsdon
Copy link

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

  • Refactor existing test code into more meaningful classes: i.e.
    • <Generator>ColumnTests.cs
    • <Generator>DataTests.cs
    • <Generator>TableTests.cs
  • Add extra tests to improve test coverage

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

@matthewdunsdon
Copy link
Author

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.

@daniellee
Copy link
Contributor

Great work again, Matthew! How long did this take you? It looks like you added more than 600 tests for the generator classes!

🌟 🌟 🌟

daniellee added a commit that referenced this pull request May 26, 2013
@daniellee daniellee merged commit c6f7326 into fluentmigrator:master May 26, 2013
@tommarien
Copy link
Contributor

@matthewdunsdon Cheers mate, amazing work :)

@matthewdunsdon matthewdunsdon deleted the RefactorGeneratorTests branch May 26, 2013 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants