From c9bb54c3ac5195e54a55d2549baa0b18f19b72b8 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Wed, 14 Aug 2024 20:21:56 +0200 Subject: [PATCH 1/4] Adding a paragraph about the startupobject, ref Issue https://github.com/nunit/nunit/issues/4780 --- .../nunit/running-tests/NUnitLite-Runner.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/articles/nunit/running-tests/NUnitLite-Runner.md b/docs/articles/nunit/running-tests/NUnitLite-Runner.md index 462691f6f..30c864794 100644 --- a/docs/articles/nunit/running-tests/NUnitLite-Runner.md +++ b/docs/articles/nunit/running-tests/NUnitLite-Runner.md @@ -57,3 +57,16 @@ installed and referenced for you. As seen in the following screen shot, the output from an NUnitLite run is quite similar to that from the console runner. ![Screenshot of NUnitLite](~/images/nunitlite-mock.png) + +## Tips + +### Testing a console application + +When testing a console application, you can use the NUnitLite runner to execute your tests. However, this approach will result in having two Main methods in your application. To resolve this, you need to specify which Main method to use — specifically, the Main method from the test project. Additionally, you must indicate which class contains this method. + +You do this by adding a `StartupObject` to your project file: + +```xml + TestProject.Program +``` + From d21e88069977e2b580062e991dd78985b0fe3ada Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Wed, 14 Aug 2024 20:24:08 +0200 Subject: [PATCH 2/4] Adding a paragraph about the startupobject, ref Issue https://github.com/nunit/nunit/issues/4780 --- docs/articles/nunit/running-tests/NUnitLite-Runner.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/articles/nunit/running-tests/NUnitLite-Runner.md b/docs/articles/nunit/running-tests/NUnitLite-Runner.md index 30c864794..c8acfc852 100644 --- a/docs/articles/nunit/running-tests/NUnitLite-Runner.md +++ b/docs/articles/nunit/running-tests/NUnitLite-Runner.md @@ -60,9 +60,9 @@ As seen in the following screen shot, the output from an NUnitLite run is quite ## Tips -### Testing a console application +### Testing an executable application -When testing a console application, you can use the NUnitLite runner to execute your tests. However, this approach will result in having two Main methods in your application. To resolve this, you need to specify which Main method to use — specifically, the Main method from the test project. Additionally, you must indicate which class contains this method. +When testing an executable application, you can use the NUnitLite runner to execute your tests. However, this approach will result in having two Main methods in your application. To resolve this, you need to specify which Main method to use — specifically, the Main method from the test project. You do this by stating which class contains this method. You do this by adding a `StartupObject` to your project file: From 290b26b0c572baf510f202f64748a9ae941376df Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Wed, 14 Aug 2024 20:24:48 +0200 Subject: [PATCH 3/4] fix warnings --- docs/articles/nunit/running-tests/NUnitLite-Runner.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/articles/nunit/running-tests/NUnitLite-Runner.md b/docs/articles/nunit/running-tests/NUnitLite-Runner.md index c8acfc852..7681234f7 100644 --- a/docs/articles/nunit/running-tests/NUnitLite-Runner.md +++ b/docs/articles/nunit/running-tests/NUnitLite-Runner.md @@ -69,4 +69,3 @@ You do this by adding a `StartupObject` to your project file: ```xml TestProject.Program ``` - From 4b471b351c877f8dba427566e1f903f0455588eb Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Wed, 14 Aug 2024 20:26:16 +0200 Subject: [PATCH 4/4] fix warnings --- docs/articles/nunit/running-tests/NUnitLite-Runner.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/articles/nunit/running-tests/NUnitLite-Runner.md b/docs/articles/nunit/running-tests/NUnitLite-Runner.md index 7681234f7..807388294 100644 --- a/docs/articles/nunit/running-tests/NUnitLite-Runner.md +++ b/docs/articles/nunit/running-tests/NUnitLite-Runner.md @@ -62,7 +62,10 @@ As seen in the following screen shot, the output from an NUnitLite run is quite ### Testing an executable application -When testing an executable application, you can use the NUnitLite runner to execute your tests. However, this approach will result in having two Main methods in your application. To resolve this, you need to specify which Main method to use — specifically, the Main method from the test project. You do this by stating which class contains this method. +When testing an executable application, you can use the NUnitLite runner to execute your tests. +However, this approach will result in having two Main methods in your application. To resolve this, +you need to specify which Main method to use — specifically, the Main method from the test project. +You do this by stating which class contains this method. You do this by adding a `StartupObject` to your project file: