DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.QuestionsTest/CategoryMockData.cs

51 lines
1.9 KiB
C#
Raw Normal View History

2023-08-15 22:52:30 -05:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DamageAssesment.Api.Questions.Test
{
public class CategoryMockData
{
2023-09-08 14:40:06 -05:00
public static async Task<(bool, IEnumerable<Questions.Models.MultiLanQuestionCategory>, string)> getOkResponse()
2023-08-15 22:52:30 -05:00
{
2023-09-08 14:40:06 -05:00
IEnumerable<Questions.Models.MultiLanQuestionCategory> list = new List<Questions.Models.MultiLanQuestionCategory>();
2023-08-15 22:52:30 -05:00
for (int i = 0; i < 10; i++)
{
2023-09-08 14:40:06 -05:00
list.Append(new Questions.Models.MultiLanQuestionCategory { Id = i, IconLibrary = "img"+i,IconName="Category "+i });
2023-08-15 22:52:30 -05:00
}
return (true, list, null);
}
2023-09-08 14:40:06 -05:00
public static async Task<(bool, Questions.Models.MultiLanQuestionCategory, string)> getOkResponse(int Id)
2023-08-15 22:52:30 -05:00
{
var Questions = await getOkResponse();
var Question = Questions.Item2.FirstOrDefault(s => s.Id == Id);
return (true, Question, null);
}
2023-09-08 14:40:06 -05:00
public static async Task<(bool, Questions.Models.MultiLanQuestionCategory, string)> getBadRequestResponse()
2023-08-15 22:52:30 -05:00
{
return (false, null, "Bad Request");
}
2023-09-08 14:40:06 -05:00
public static async Task<(bool, Questions.Models.MultiLanQuestionCategory, string)> getNotFoundResponse()
2023-08-15 22:52:30 -05:00
{
return (false, null, "Not Found");
}
2023-09-08 14:40:06 -05:00
public static async Task<(bool, IEnumerable<Questions.Models.MultiLanQuestionCategory>, string)> getNoContentResponse()
2023-08-15 22:52:30 -05:00
{
2023-09-08 14:40:06 -05:00
IEnumerable<Questions.Models.MultiLanQuestionCategory> list = new List<Questions.Models.MultiLanQuestionCategory>();
2023-08-15 22:52:30 -05:00
return (false, list, null);
}
public static async Task<Questions.Models.QuestionCategory> getInputQuestionCategoryData()
{
2023-09-08 14:40:06 -05:00
return new Questions.Models.QuestionCategory { Id = 1, IconName = "Category 1",IconLibrary="img 1" };
2023-08-15 22:52:30 -05:00
}
}
}