DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Answers.Test/MocData.cs
2023-08-25 18:24:46 -04:00

54 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DamageAssesment.Api.Answers.Test
{
public class MockData
{
public static async Task<(bool, IEnumerable<Answers.Models.Answer>, string)> getOkResponse()
{
IEnumerable<Answers.Models.Answer> list = new List<Answers.Models.Answer>();
for (int i = 0; i < 10; i++)
{
list.Append(new Answers.Models.Answer { Id = i, AnswerText = "Yes", Comment = "", QuestionId = i, SurveyResponseId = i });
}
return (true, list, null);
}
public static async Task<(bool, Answers.Models.Answer, string)> getOkResponse(int Id)
{
var Answers = await getOkResponse();
var Answer = Answers.Item2.FirstOrDefault(s => s.Id == Id);
return (true, Answer, null);
}
public static async Task<(bool, Answers.Models.Answer, string)> getBadRequestResponse()
{
return (false, null, "Bad Request");
}
public static async Task<(bool, Answers.Models.Answer, string)> getNotFoundResponse()
{
return (false, null, "Not Found");
}
public static async Task<(bool, IEnumerable<Answers.Models.Answer>, string)> getNoContentResponse()
{
IEnumerable<Answers.Models.Answer> list = new List<Answers.Models.Answer>();
return (false, list, null);
}
public static async Task<Answers.Models.Answer> getInputAnswerData()
{
return new Answers.Models.Answer { Id = 1, AnswerText = "Yes", Comment = "", QuestionId = 1, SurveyResponseId = 1 };
}
}
}