-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from contentstack/develop
API implementation for Sync and Content Type information.
- Loading branch information
Showing
35 changed files
with
1,461 additions
and
350 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 |
---|---|---|
|
@@ -18,4 +18,3 @@ packages/ | |
*.config | ||
*.nupkg | ||
*.nuspec | ||
Contentstack.core/docfx_project/* |
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,23 @@ | ||
### Version: 1.1.0 | ||
#### Date: Apr-12-2019 | ||
|
||
##### New Features: | ||
- ContentstackClient | ||
- added method 'GetContentTypes' | ||
- added method 'SyncRecursive' | ||
- added method 'SyncRecursiveLanguage' | ||
- added method 'SyncPaginationToken' | ||
- added method 'SyncToken' | ||
|
||
- CotentType | ||
- added method 'Fetch' | ||
|
||
### Version: 1.0.6 | ||
#### Date: Apr-12-2019 | ||
|
||
Localization support for Query and Entry is added. | ||
|
||
### Version: 1.0.0 | ||
#### Date: Apr-12-2019 | ||
|
||
- Introduce ContentStack SDK for DOTNET. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using Xunit; | ||
using Contentstack.Core.Models; | ||
using System.Threading.Tasks; | ||
using Contentstack.Core.Configuration; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
using System.Collections; | ||
|
||
namespace Contentstack.Core.Tests | ||
{ | ||
public class ContentTypeTest | ||
|
||
{ | ||
ContentstackClient client = StackConfig.GetStack(); | ||
String source = "source"; | ||
|
||
[Fact] | ||
public async Task FetchContenTypeSchema() | ||
{ | ||
ContentType contenttype = client.ContentType(source); | ||
var result = await contenttype.Fetch(); | ||
if (result == null) | ||
{ | ||
Assert.False(true, "contenttype.FetchSchema() is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task GetContentTypes() | ||
{ | ||
var result = await client.GetContentTypes(); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "client.getContentTypes is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
|
||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
using System; | ||
using Xunit; | ||
using Contentstack.Core.Configuration; | ||
using System.Threading.Tasks; | ||
|
||
namespace Contentstack.Core.Tests | ||
{ | ||
public class SyncStackTest | ||
{ | ||
ContentstackClient client = StackConfig.GetSyncStack(); | ||
|
||
[Fact] | ||
public async Task SyncInit() | ||
{ | ||
|
||
var result = await client.SyncRecursive(); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task SyncSyncType() | ||
{ | ||
|
||
var result = await client.SyncRecursive(SyncType: Models.SyncType.asset_published); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
[Fact] | ||
public async Task SyncContentType() | ||
{ | ||
|
||
var result = await client.SyncRecursive(ContentTypeUid: "session"); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
[Fact] | ||
public async Task SyncStartFrom() | ||
{ | ||
|
||
var result = await client.SyncRecursive(StartFrom:DateTime.Now); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
[Fact] | ||
public async Task SyncTypeWithContentType() | ||
{ | ||
|
||
var result = await client.SyncRecursive(SyncType: Models.SyncType.entry_published, ContentTypeUid: "session"); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
[Fact] | ||
public async Task SyncTypeWithStartFrom() | ||
{ | ||
|
||
var result = await client.SyncRecursive(SyncType: Models.SyncType.entry_published, StartFrom:DateTime.Now); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task SyncPaginationToken() | ||
{ | ||
|
||
var result = await client.SyncPaginationToken("***REMOVED***"); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task SyncToken() | ||
{ | ||
|
||
var result = await client.SyncToken("***REMOVED***"); | ||
|
||
if (result == null) | ||
{ | ||
Assert.False(true, "Entry.Fetch is not match with expected result."); | ||
} | ||
else | ||
{ | ||
Assert.True(true); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.