Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Test using Owin TestServer fails
jonwik
#1 Posted : Wednesday, November 22, 2017 8:02:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/8/2017(UTC)
Posts: 4

Was thanked: 1 time(s) in 1 post(s)
Hello!

Trying to use NCrunch for integration tests against our REST-API using Owin TestServer. No problems when running other test-runners than NCrunch (e.g. Resharper) but when using NCrunch result is always 404 Not Found.
Anybody have a clue why?

Regards
>> Jonas
Remco
#2 Posted : Wednesday, November 22, 2017 8:14:02 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Jonas,

My best guess would be that the server can't find its end-points when it is being hosted in an NCrunch workspace.

I recommend taking a look at your test project when it is hosted in the NCrunch workspace (right click on the test project in the Tests Window, go to Advanced->Browse to workspace), to see how a test project exists when its tests are being run by NCrunch. It's possible this project has an implicit dependency on the web project hosting the endpoints.

Related documentation:

http://www.ncrunch.net/documentation/concepts_workspaces
http://www.ncrunch.net/documentation/considerations-and-constraints_project-atomicity
http://www.ncrunch.net/documentation/considerations-and-constraints_implicit-file-dependencies
jonwik
#3 Posted : Wednesday, November 22, 2017 8:31:36 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/8/2017(UTC)
Posts: 4

Was thanked: 1 time(s) in 1 post(s)
Thanks Remco

Did forget to mention that this is .NET Core.
Remco
#4 Posted : Wednesday, November 22, 2017 10:14:52 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks. Are you using Microsoft.AspNet.TestHost?
jonwik
#5 Posted : Wednesday, November 22, 2017 11:24:13 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/8/2017(UTC)
Posts: 4

Was thanked: 1 time(s) in 1 post(s)
Yes, Microsoft.AspNet.TestHost 2.0

I'm using the Microsoft.AspNetCore.TestHost.TestServer existing within the Microsoft.AspNetCore.TestHost nuget.
NCrunch working fine when using "ordinary" .NET Framework and it's Microsoft.Owin.Testing.TestServer .
Remco
#6 Posted : Wednesday, November 22, 2017 9:46:03 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
jonwik
#7 Posted : Thursday, November 23, 2017 2:29:00 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/8/2017(UTC)
Posts: 4

Was thanked: 1 time(s) in 1 post(s)
Great

That version seems to fix the errors! Thanks!
1 user thanked jonwik for this useful post.
Remco on 11/23/2017(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.041 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download