Skip to content

Refactoring #38

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 6 commits into from
Sep 26, 2014
Merged

Refactoring #38

merged 6 commits into from
Sep 26, 2014

Conversation

AlexArchive
Copy link
Contributor

  • Extracted a number of partial classes from the ControllerResultTest class.
  • Extracted a number of partial classes from the ControllerResultTestTests class.
  • Included solution specific Resharper settings (TestStack.FluentMVCTesting.sln.DotSettings file) that disable namespace warnings.
  • Removed some whitespace and obsolete using directives here and there.

I have not touched the "OldMvc" folder but it looks buggered. I want to see what the CI says. After doing a git clean it looks ... clean. No worries there after all.

@robdmoore
Copy link
Member

Looks good. Presumably we can get the same happening for the other classes in separate pull requests unless you don't think they need it?

The test classes probably don't need to be partial classes and in fact, we can probably make the implementation partial classes extension methods and get rid of the partial classes altogether, no big deal though and happy for that to be a separate PR if we decide to do it.

There is one #region left behind that you missed by the looks and also telling resharper to hide the namespace warning probably doesn't prevent it using the wrong namespace when creating a new file? There is a setting to override the namespace for a given folder using the settings file (or possibly a separate settings file in the folder in question; I can't remember); let me know if you can't find it and I'll find it for you.

FYI If you add or remove files then you need to unload and reload those projects for them to reflect the changes (or reload the sln).

Rob Moore | Readify Lead Consultant, Technical Specialist (Microsoft Azure) | m +61 400 777 763 | e rob.moore@readify.net | w readify.net

On 26 Sep 2014, at 1:31 am, ByteBlast notifications@github.com wrote:

Extracted a number of partial classes from the ControllerResultTest class.
Extracted a number of partial classes from the ControllerResultTestTests class.
Included solution specific Resharper settings (TestStack.FluentMVCTesting.sln.DotSettings file) that disable namespace warnings.
Removed some whitespace and obsolete using directives here and there.
I have not touched the "OldMvc" folder but it looks buggered. I want to see what the CI says.

You can merge this Pull Request by running

git pull https://github.com/ByteBlast/TestStack.FluentMVCTesting master
Or view, comment on, or merge it at:

#38

Commit Summary

Pedantic tweaks.
Refactored ControllerResultTest.
Refactored ControllerResultTest tests.
Included Resharper DotSettings.
File Changes

M .gitignore (1)
D TestStack.FluentMVCTesting.Tests/ControllerResultTestTests.cs (857)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ControllerResultTestTests.cs (82)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldGiveHttpStatusTests.cs (30)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldRedirectToTests.cs (191)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldRenderFileTests.cs (425)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldRenderViewTests.cs (62)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldReturnContentTests.cs (84)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldReturnEmptyResultTests.cs (13)
A TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldReturnJsonTests.cs (14)
M TestStack.FluentMVCTesting.Tests/TestStack.FluentMVCTesting.Tests.csproj (9)
A TestStack.FluentMVCTesting.sln.DotSettings (2)
D TestStack.FluentMvcTesting/ControllerResultTest.cs (436)
A TestStack.FluentMvcTesting/ControllerResultTest/ControllerResultTest.cs (33)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldGiveHttpStatus.cs (32)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldRedirectTo.cs (131)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldRenderFile.cs (150)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldRenderView.cs (41)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldReturnContent.cs (40)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldReturnEmptyResult.cs (12)
A TestStack.FluentMvcTesting/ControllerResultTest/ShouldReturnJson.cs (20)
M TestStack.FluentMvcTesting/Exceptions.cs (1)
M TestStack.FluentMvcTesting/RouteValueDictionaryExtension.cs (3)
M TestStack.FluentMvcTesting/TestStack.FluentMVCTesting.csproj (9)
Patch Links:

https://github.com/TestStack/TestStack.FluentMVCTesting/pull/38.patch
https://github.com/TestStack/TestStack.FluentMVCTesting/pull/38.diff

Reply to this email directly or view it on GitHub.

@AlexArchive
Copy link
Contributor Author

Presumably we can get the same happening for the other classes.

I am happy to refactor them when the need presents itself. I haven't worked too much with those classes you see 😟

The test classes probably don't need to be partial classes

It makes more sense to use a partial class for the implementation in my opinion.
I suppose the tests should be implemented as independent classes after all.

I will work on some of these things now ✋

@AlexArchive
Copy link
Contributor Author

I think I found the option you are talking about.

Setting this property to False disables the namespace warnings in a different way and also prevents new code files from adopting the folder namespace.

This is only true when you use Resharper exclusively to add the code file though.

When you add a code file using VS in the traditional manner, the folder namespace is still adopted 😕

Is this the option you had in mind?

@robdmoore
Copy link
Member

I think so :)

On 26 Sep 2014, at 8:30 pm, ByteBlast notifications@github.com wrote:

I think I found the option you are talking about.

Setting this property to False disables the namespace warnings in a different way and also prevents new code files from adopting the folder namespace.

This is only true when you use Resharper exclusively to add the code file though.

When you add a code file using VS in the traditional manner, the folder namespace is adopted.

Is this the option you had in mind?


Reply to this email directly or view it on GitHub.

AlexArchive added a commit that referenced this pull request Sep 26, 2014
Refactored ControllerResultTest class.
@AlexArchive AlexArchive merged commit ed98e0e into TestStack:master Sep 26, 2014
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.

2 participants