-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved search parameters handling, two basic tests, fix iwebdavclie…
…nt typo.
- Loading branch information
1 parent
05146a0
commit e0318b7
Showing
5 changed files
with
72 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Xml.Linq; | ||
using WebDav.Client.Tests.TestDoubles; | ||
using Xunit; | ||
|
||
namespace WebDav.Client.Tests.Methods | ||
{ | ||
public class SearchTests | ||
{ | ||
[Fact] | ||
public async void When_RequestIsSuccessfull_Should_ReturnStatusCode200() | ||
{ | ||
var client = new WebDavClient().SetWebDavDispatcher(Dispatcher.Mock()); | ||
var response1 = await client.Search(new Uri("http://example.com/"), new Request.SearchParameters() | ||
{ | ||
SearchPath = "/root/", | ||
SearchKeyword = "test%", | ||
SelectProperties = new[] | ||
{ | ||
new XElement("{DAV:}displayname"), | ||
new XElement("{DAV:}getcontenttype") | ||
}, | ||
WhereProperties = new[] | ||
{ | ||
new XElement("{DAV:}displayname") | ||
} | ||
}); | ||
|
||
Assert.Equal(200, response1.StatusCode); | ||
} | ||
|
||
[Fact] | ||
public async void When_RequestIsBadRequest_Should_ReturnStatusCode400() | ||
{ | ||
var client = new WebDavClient().SetWebDavDispatcher(Dispatcher.Mock()); | ||
var response1 = await client.Search(new Uri("http://example.com/"), new Request.SearchParameters()); | ||
Assert.Equal(400, response1.StatusCode); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters