DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Answers.Test/MocData.cs

54 lines
1.7 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.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);
}
2023-08-25 17:24:46 -05:00
public static async Task<Answers.Models.Answer> getInputAnswerData()
2023-08-15 22:52:30 -05:00
{
2023-08-25 17:24:46 -05:00
return new Answers.Models.Answer { Id = 1, AnswerText = "Yes", Comment = "", QuestionId = 1, SurveyResponseId = 1 };
2023-08-15 22:52:30 -05:00
}
}
}