-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f46587
commit 5aa18ea
Showing
2 changed files
with
104 additions
and
25 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,42 @@ | ||
using Newtonsoft.Json; | ||
using ButterCMS.Models; | ||
using ButterCMS.Tests.Models; | ||
|
||
namespace ButterCMS.Tests | ||
{ | ||
public static class ContentFieldsMocks | ||
{ | ||
public static ContentResponse<TeamMembersHeadline> ContentFieldsResponse = new ContentResponse<TeamMembersHeadline>() | ||
{ | ||
Data = new TeamMembersHeadline() | ||
{ | ||
homepage_headline = "ButterCMS C# SDK", | ||
team_members = new[] | ||
{ | ||
new Team_Members() | ||
{ | ||
name = "Elon", | ||
bio = "CEO" | ||
}, | ||
new Team_Members() | ||
{ | ||
name = "Steve", | ||
bio = "CTO" | ||
} | ||
} | ||
} | ||
}; | ||
|
||
public const string ContentFieldsJSON = "{\"data\":{\"team_members\":[{\"bio\":\"CEO\",\"name\":\"Elon\"},{\"bio\":\"CTO\",\"name\":\"Steve\"}],\"homepage_headline\":\"ButterCMS C# SDK\",}}"; | ||
|
||
public static void MockSuccessfullContentFieldsJSONResponse(this ButterCMSClientWithMockedHttp butterClient, string[] keys, TeamMembersHeadline response) | ||
{ | ||
butterClient.MockSuccessfullJSONResponse($"https://api.buttercms.com/v2/content/?auth_token={ButterCMSClientWithMockedHttp.MockedApiKey}&keys={string.Join(",", keys)}", response); | ||
} | ||
|
||
public static void MockSuccessfullContentFieldsResponse(this ButterCMSClientWithMockedHttp butterClient, string[] keys, ContentResponse<TeamMembersHeadline> response) | ||
{ | ||
butterClient.MockSuccessfullJSONResponse($"https://api.buttercms.com/v2/content/?auth_token={ButterCMSClientWithMockedHttp.MockedApiKey}&keys={string.Join(",", keys)}", response); | ||
} | ||
} | ||
} |
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