54 lines
1.8 KiB
C#
54 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xunit.Sdk;
|
|
|
|
namespace DamageAssesment.Api.Survey.Test
|
|
{
|
|
public class MockData
|
|
{
|
|
public static async Task<(bool, IEnumerable<Surveys.Models.MultiLanSurvey>, string)> getOkResponse()
|
|
{
|
|
IEnumerable<Surveys.Models.MultiLanSurvey> list = new List<Surveys.Models.MultiLanSurvey>();
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
list.Append(new Surveys.Models.MultiLanSurvey { Id = i, /*Title = "Survey Title - " + i */});
|
|
}
|
|
return (true, list, null);
|
|
}
|
|
|
|
|
|
public static async Task<(bool, Surveys.Models.MultiLanSurvey, string)> getOkResponse( int Id)
|
|
{
|
|
var surveys = await getOkResponse();
|
|
var survey = surveys.Item2.FirstOrDefault(s => s.Id == Id);
|
|
return (true, survey, null);
|
|
}
|
|
|
|
public static async Task<(bool, Surveys.Models.MultiLanSurvey, string)> getBadRequestResponse()
|
|
{
|
|
return (false, null,"Bad Request");
|
|
}
|
|
|
|
public static async Task<(bool, Surveys.Models.MultiLanSurvey, string)> getNotFoundResponse()
|
|
{
|
|
return (false, null, "Not Found");
|
|
}
|
|
public static async Task<(bool, IEnumerable<Surveys.Models.MultiLanSurvey>, string)> getNoContentResponse()
|
|
{
|
|
IEnumerable<Surveys.Models.MultiLanSurvey> list = new List<Surveys.Models.MultiLanSurvey>();
|
|
return (false, list, null);
|
|
}
|
|
|
|
public static async Task<Surveys.Models.Survey> getInputSurveyData()
|
|
{
|
|
return new Surveys.Models.Survey { Id = 100, /*Title = "Mock survey",*/ IsEnabled= true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90) };
|
|
|
|
}
|
|
|
|
}
|
|
}
|