-
Notifications
You must be signed in to change notification settings - Fork 11
Improve unit tests #23
Comments
Maybe you can use NWebDav using ASP.NET Core using its test host? You can use ASP.NET Core in a .NET Framework project as long as you manually provide the libuv DLL for the correct platform (i.e. setting the test project platform from AnyCPU to e.g. x86) or you can convert the test project to .NET Core which - as of preview3 (or better: RC4) can target your .NET Framework project. |
Could you also please not use the Found in the following tests: UIT_NetFx_WebDavClient_Copy |
@TomGroeneboer I'll keep this in mind. The unit integration test needs be be improved in general: I have to check the exact result (e.g. of a PropFind), not only if the result is not null and can be parsed. |
FYI: There is a bug in VS 2017 when running UnitTest in debug mode: microsoft/vstest#311 |
@fubar-coder: I've tried to use NWebDav locally to run the unit test against. But unfortunately, it doesn't seem to support some scenarios. E.g. when trying to execute a propfind with depth 'infinity', you'll get following message: "Not allowed to obtain properties with infinite depth.". So, I would need a (local) WebDAV server which can be integrated in the unit integration tests and supports every constellation one can think of. I don't want to test a specific WebDAV server with my unit tests here. So I think I should mock the server side. On the other hand, this can be risky as I'm not testing "real world scenarios" then; when there is an error in the mocked WebDAV server, the library would also contain an error. Any ideas about this issue are most appreciated... 😄 |
With the lastest update of Visual Studio 2017, this bug is fixed. You can now run the unit tests in debug mode again. |
I've made some tests mocking away the WebDAV server (IIS, Nextcloud, etc.), so that the request do not hit the network at all and that the unit integration tests can run "offline". Using MockHttp seems to do the trick. Great project, btw. 👍 I've created a separate branch for this as it will take some time: https://github.com/DecaTec/Portable-WebDAV-Library/tree/unit-tests However, I'll keep the unit integration tests which target a specific WebDAV server implementation, so everybody can run some tests against a specific WebDAV server. |
I just branched the new unit-test branch into master. I've decided to move the mocked test for @TomGroeneboer Do you still need integration tests not using I'm concentrating on the (mocked) unit tests because they do not depend on any specific WebDAV server implementation. |
Finally resolved with d3b35f2 |
The text was updated successfully, but these errors were encountered: