51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DamageAssesment.Api.Questions.Test
|
|
{
|
|
public class CategoryMockData
|
|
{
|
|
public static async Task<(bool, IEnumerable<Questions.Models.QuestionCategory>, string)> getOkResponse()
|
|
{
|
|
IEnumerable<Questions.Models.QuestionCategory> list = new List<Questions.Models.QuestionCategory>();
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
list.Append(new Questions.Models.QuestionCategory { Id = i, CategoryImage = "img"+i,CategoryName="Category "+i });
|
|
}
|
|
return (true, list, null);
|
|
}
|
|
|
|
public static async Task<(bool, Questions.Models.QuestionCategory, string)> getOkResponse(int Id)
|
|
{
|
|
var Questions = await getOkResponse();
|
|
var Question = Questions.Item2.FirstOrDefault(s => s.Id == Id);
|
|
return (true, Question, null);
|
|
}
|
|
|
|
public static async Task<(bool, Questions.Models.QuestionCategory, string)> getBadRequestResponse()
|
|
{
|
|
return (false, null, "Bad Request");
|
|
}
|
|
|
|
public static async Task<(bool, Questions.Models.QuestionCategory, string)> getNotFoundResponse()
|
|
{
|
|
return (false, null, "Not Found");
|
|
}
|
|
public static async Task<(bool, IEnumerable<Questions.Models.QuestionCategory>, string)> getNoContentResponse()
|
|
{
|
|
IEnumerable<Questions.Models.QuestionCategory> list = new List<Questions.Models.QuestionCategory>();
|
|
return (false, list, null);
|
|
}
|
|
|
|
public static async Task<Questions.Models.QuestionCategory> getInputQuestionCategoryData()
|
|
{
|
|
return new Questions.Models.QuestionCategory { Id = 1, CategoryName = "Category 1",CategoryImage="img 1" };
|
|
|
|
}
|
|
}
|
|
}
|