-
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
e5d8ff3
commit 182181a
Showing
2 changed files
with
68 additions
and
2 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
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,40 @@ | ||
using ButterCMS.Models; | ||
|
||
namespace ButterCMS.Tests | ||
{ | ||
public static class CategoriesMocks | ||
{ | ||
public static Category Category = new Category() | ||
{ | ||
Name = "Category", | ||
Slug = "category", | ||
}; | ||
|
||
public static Category CategoryWithPosts = new Category() | ||
{ | ||
Name = "Category", | ||
Slug = "category", | ||
RecentPosts = new[] { new Post() { Slug = "post-1" }, new Post() { Slug = "post-2" } } | ||
}; | ||
|
||
public static CategoriesResponse CategoriesResponse = new CategoriesResponse() | ||
{ | ||
Data = new[] { Category }, | ||
}; | ||
|
||
public static CategoriesResponse CategoriesResponseWithPosts = new CategoriesResponse() | ||
{ | ||
Data = new[] { CategoryWithPosts }, | ||
}; | ||
|
||
public static void MockSuccessfullCategoriesResponse(this ButterCMSClientWithMockedHttp butterClient) | ||
{ | ||
butterClient.MockSuccessfullJSONResponse($"https://api.buttercms.com/v2/categories/?auth_token={ButterCMSClientWithMockedHttp.MockedApiKey}", CategoriesResponse); | ||
} | ||
|
||
public static void MockSuccessfullCategoriesResponseWithPosts(this ButterCMSClientWithMockedHttp butterClient) | ||
{ | ||
butterClient.MockSuccessfullJSONResponse($"https://api.buttercms.com/v2/categories/?auth_token={ButterCMSClientWithMockedHttp.MockedApiKey}&include=recent_posts", CategoriesResponseWithPosts); | ||
} | ||
} | ||
} |