Roald87 / TcBlack

Opnionated code formatter for TwinCAT.
MIT License
103 stars 11 forks source link

Fix final and abstract access modifiers #34

Closed kdorsel closed 4 years ago

kdorsel commented 4 years ago

Fix for abstract and final access modifiers for FB and methods Fixes #32 #36

Roald87 commented 4 years ago

Hey kdorsel,

Thanks you very much for the PR. I'll have look at it tomorrow.

Roald

kdorsel commented 4 years ago

Can you also add some tests to the TcBlackTests project in ObjectDefinitionTests.cs? Perhaps best to collect the tests in a new method, something like AbstractAndFinalModifiersForMethodsAndFunctionBlocks

I'll create a test suite for these.

kdorsel commented 4 years ago

I'm having troubles with loading the test project with this error:

C:\Users\kdorsel\Documents\github\TcBlack\src\TcBlackTests\TcBlackTests.csproj : error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. C:\Users\kdorsel\Documents\github\TcBlack\src\TcBlackTests\TcBlackTests.csproj

Comparing the TcBlack and TcBlackTests csproj they are completely different. I'm using VS2015.

Roald87 commented 4 years ago

I haven't tried to run the project with VS2015. In the contributing https://github.com/Roald87/TcBlack/blob/master/CONTRIBUTING.md#use-a-consistent-coding-style document I recommend to use VS2017. Is that an issue for you?

The fact that they are so different is an artifact from the past. I initially stared the project using .NET Core. Later I converted to the .NET Framework. Apparently I didn't convert the unit test project.

I'll have a look if I can convert the unit test project as well.

kdorsel commented 4 years ago

I need VS2015 since TC3 Database Server doesn't work on VS2017 yet. I can get VS2017 also, but beside that file I haven't had any issues.

Roald87 commented 4 years ago

Ok let me try to change it. As long as you don't upload the .csproj file maybe it'll be fine.

Roald87 commented 4 years ago

Does the test in this branch run?

https://github.com/Roald87/TcBlack/tree/xunit-in-net-framework

kdorsel commented 4 years ago

The UnitTestDotNetFramework project loads and I can access it. But when I Run All Tests I get no results and it looks like no tests are run.

I'll look more into it. I'll also get VS2017 and try and report back.

https://xunit.net/docs/getting-started/netfx/visual-studio https://stackoverflow.com/questions/44573009/does-xunit-runner-visualstudio-not-work-for-visual-studio

Roald87 commented 4 years ago

Is was some option under Tests > General I believe which you have to disable. It was something with optimization blabla. You should turn that off, then it worked for me.

kdorsel commented 4 years ago

In VS2017, everything works fine from the main branch (TcBlackTests). I'll work on adding the tests now for this.

Sorry for adding the extra work! The xunit-in-net-framework branch is no longer needed.

Roald87 commented 4 years ago

No problem. I didn't want to scare away the first contributor 😛 .

kdorsel commented 4 years ago

Updated with tests and also closes #36 now.

Roald87 commented 4 years ago

Thank you very much for your contribution!