forked from MDCPS/DamageAssessment_Backend
Copy from old Repository
This commit is contained in:
@ -0,0 +1,53 @@
|
||||
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.Survey>, string)> getOkResponse()
|
||||
{
|
||||
IEnumerable<Surveys.Models.Survey> list = new List<Surveys.Models.Survey>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
list.Append(new Surveys.Models.Survey { Id = i, Title = "Survey Title - " + i });
|
||||
}
|
||||
return (true, list, null);
|
||||
}
|
||||
|
||||
|
||||
public static async Task<(bool, Surveys.Models.Survey, 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.Survey, string)> getBadRequestResponse()
|
||||
{
|
||||
return (false, null,"Bad Request");
|
||||
}
|
||||
|
||||
public static async Task<(bool, Surveys.Models.Survey, string)> getNotFoundResponse()
|
||||
{
|
||||
return (false, null, "Not Found");
|
||||
}
|
||||
public static async Task<(bool, IEnumerable<Surveys.Models.Survey>, string)> getNoContentResponse()
|
||||
{
|
||||
IEnumerable<Surveys.Models.Survey> list = new List<Surveys.Models.Survey>();
|
||||
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) };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user