forked from Speedygeek/ZendeskApi_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added 2 section unit tests. Update fails as expected.
- Loading branch information
1 parent
11552d1
commit 8ca94c0
Showing
2 changed files
with
42 additions
and
0 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,41 @@ | ||
using NUnit.Framework; | ||
using ZendeskApi_v2; | ||
using ZendeskApi_v2.Models.Sections; | ||
using ZendeskApi_v2.Requests.HelpCenter; | ||
|
||
namespace Tests.HelpCenter | ||
{ | ||
[TestFixture] | ||
[Category( "HelpCenter" )] | ||
class SectionTests | ||
{ | ||
private ZendeskApi api = new ZendeskApi( Settings.Site, Settings.Email, Settings.Password ); | ||
|
||
[Test] | ||
|
||
public void CanGetSections() | ||
{ | ||
var res = api.HelpCenter.Sections.GetSections(); | ||
Assert.Greater( res.Count, 0 ); | ||
|
||
var res1 = api.HelpCenter.Sections.GetSectionById( res.Sections[ 0 ].Id.Value ); | ||
Assert.AreEqual( res1.Section.Id, res.Sections[ 0 ].Id.Value ); | ||
} | ||
|
||
[Test] | ||
public void CanCreateUpdateAndDeleteSections() | ||
{ | ||
var res = api.HelpCenter.Sections.CreateSection( new Section() | ||
{ | ||
Name = "My Test section" | ||
} ); | ||
Assert.Greater( res.Section.Id, 0 ); | ||
|
||
res.Section.Description = "updated description"; | ||
var update = api.HelpCenter.Sections.UpdateSection( res.Section ); | ||
Assert.AreEqual( update.Section.Description, res.Section.Description ); | ||
|
||
Assert.True( api.HelpCenter.Sections.DeleteSection( res.Section.Id.Value ) ); | ||
} | ||
} | ||
} |
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