NUnit (testing) - any success in VS 2017 ?

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

NUnit (testing) - any success in VS 2017 ?

Post by Phil Hepburn »

Hi guys,

Today and yesterday I have been encouraged by Frank to get into Unit Testing with X# and Visual Studio 2017 (public release).

Well, after a bit of a fight, and much frustration, I have managed to get some positive results (a start) with C# and the simplest of test possible ;-0)

I attached the images of my first steps to success.

However, I am posting to ask you guys if anyone has managed to get the latest version of NUnit (v3) to work with X# in VS 2017. It seems to be so close to working, and does not throw any errors as such.

I also realise that Beta 10 and the VS2017 improved integration is more likely to get things working - BUT - I just wondered if anyone can help guide me with my first simple steps to TESTING.

Frank can help me with a lot but he does use XIDE and also version 2 of NUnit, with means there are things he can't solve for me.

Fingers crossed and TIA -
Cheers, and Best regards,
Phil.
Wales, UK.
Frank_VS2017_UT_13.jpg
Frank_VS2017_UT_13.jpg (61.12 KiB) Viewed 188 times
Frank_VS2017_UT_12.jpg
Frank_VS2017_UT_12.jpg (86.07 KiB) Viewed 188 times
Frank_VS2017_UT_11.jpg
Frank_VS2017_UT_11.jpg (78.3 KiB) Viewed 188 times
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

NUnit (testing) - any success in VS 2017 ?

Post by Phil Hepburn »

Hi guys,

I have a plan, and I have made some progress.

Having talked with Frank I have decided to use the Testing framework provided within the Visual Studio IDE, as well as it Test Explorer and plugin to it.

The thinking was that if I am new to Unit Testing and VS 2017 is public and new, I may as well use the latest version of a testing framework which is designed to work 100% with VS.

I thought that I would then have the best chance of getting X# to be able to use the in-built testing, as well as maybe even going to the limits, and get the 'Live' testing to work as well. More on that ('Live') another time.

At the moment I have managed to get a small C# sample to work in VS2017 and all seems fine and OK. This in itself is not that easy and I spent ages and much frustration trying to integrate NUnit 3.6 and the other parts to integrate. Now I an up and running with Microsoft's 'flavour' of testing.

And, I have a translated version of the same small project translated to X#, and it feels that I am almost there - but something is missing. I need help from Chris and Robert, and anyone else who may be able to help - Fabrice, Nikkos ?

For tonight lets just see the C# screen capture of success - Oh! and a red fail is also a success as there was an error to find in the code.

Check these out :-
VStesting_01.jpg
VStesting_01.jpg (94.57 KiB) Viewed 188 times
VStesting_02.jpg
VStesting_02.jpg (66.2 KiB) Viewed 188 times
VStesting_03.jpg
VStesting_03.jpg (36.98 KiB) Viewed 188 times
VStesting_04.jpg
VStesting_04.jpg (38.76 KiB) Viewed 188 times
VStesting_05.jpg
VStesting_05.jpg (81.47 KiB) Viewed 188 times
Okay - time for bed, and then tomorrow I will try and get the X# sample to work - fingers crossed,

Regards,
Phil.
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

NUnit (testing) - any success in VS 2017 ?

Post by robert »

Phil,
Phil Hepburn wrote: And, I have a translated version of the same small project translated to X#, and it feels that I am almost there - but something is missing. I need help from Chris and Robert, and anyone else who may be able to help - Fabrice, Nikkos ?
I think this uses what's called "Project Flavouring" and we will have to add some guids to our project files and maybe some special properties/code to our project system.
We will look into this a.s.a.p.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

NUnit (testing) - any success in VS 2017 ?

Post by robert »

Phil,
Phil Hepburn wrote: And, I have a translated version of the same small project translated to X#, and it feels that I am almost there - but something is missing. I need help from Chris and Robert, and anyone else who may be able to help - Fabrice, Nikkos ?
I think this uses what's called "Project Flavouring" and we will have to add some guids to our project files and maybe some special properties/code to our project system.
We will look into this a.s.a.p.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

NUnit (testing) - any success in VS 2017 ?

Post by Phil Hepburn »

Okay Robert,

Thanks for these comments.

In that case I will wait for the required extra integration.

It would seem however, like a real bonus, or plus-point for X# in Visual Studio.

Although it has taken me a while to get around to it, Frank (the evangelist) has been right about Unit Testing for quite a few years now. At a professional and business level it is a MUST do/have.

I will do my best to get it up and running for X# in VS, and after Cologne 2017 (xBase.Future) I will start to incorporate Testing into my WPF / MVVM / EF / LINQ coding solution pattern.

Regards to all,
Phil.

P.S. out of interest, what are the 'Analysers' entries shown in the following image - they appear to have been put there by the templates I selected in C#. This was one of the few things I could not manually copy when I tried an X# solution / project.
VStesting_05.jpg
VStesting_05.jpg (81.47 KiB) Viewed 188 times
Post Reply