Skip to content

Commit

Permalink
Adding support for translations (#218)
Browse files Browse the repository at this point in the history
* Added translation support for articles, sections and categories.
Only added to main project, not to net3.5 or mobile. Those projects won't build.

* Finishing up translations, but proper category support is missing, so the test won't work. waiting for rebase with fix.

* finished translation tests, they all pass now.
Missing async support.

* Added Async Help Center Translation functions and tests.

The section translation test fails becuase I forgot to fix the async section function first. This will pass once that's merged in.

* added sideload support to the Async Help Center Get Article function, to support loading translations with the article.
Added unit tests for the Sync and Async Get Article with translations.
  • Loading branch information
Marcus10110 authored and mozts2005 committed May 19, 2016
1 parent b86a6fb commit c5bf2bc
Show file tree
Hide file tree
Showing 11 changed files with 769 additions and 20 deletions.
20 changes: 18 additions & 2 deletions src/Tests/HelpCenter/ArticleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ public void CanGetSingleArticle()
Assert.IsNotNull(res.Arcticle);
}

[Test]
[Test]
public void CanGetSingleArticleWithTranslations()
{
var res = api.HelpCenter.Articles.GetArticle( _articleIdWithComments, ArticleSideLoadOptionsEnum.Translations );
Assert.IsNotNull( res.Arcticle );
Assert.Greater( res.Arcticle.Translations.Count, 0 );
}

[Test]
public void CanGetArticles()
{
var res = api.HelpCenter.Articles.GetArticles();
Expand Down Expand Up @@ -139,7 +147,15 @@ public void CanCreateUpdateAndDeleteArticles()
Assert.True(api.HelpCenter.Articles.DeleteArticle(res.Arcticle.Id.Value));
}

[Test]
[Test]
public void CanGetSingleArticleWithTranslationsAsync()
{
var res = api.HelpCenter.Articles.GetArticleAsync( _articleIdWithComments, ArticleSideLoadOptionsEnum.Translations ).Result;
Assert.IsNotNull( res.Arcticle );
Assert.Greater( res.Arcticle.Translations.Count, 0 );
}

[Test]
public void CanGetArticlesAsync()
{
var res = api.HelpCenter.Articles.GetArticlesAsync().Result;
Expand Down
Loading

0 comments on commit c5bf2bc

Please sign in to comment.