DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Employees.Test/MockData.cs

50 lines
1.8 KiB
C#

using System.Text;
namespace DamageAssesment.Api.Employees.Test
{
public class MockData
{
public static async Task<(bool, IEnumerable<Employees.Models.Employee>, string)> getOkResponse()
{
IEnumerable<Employees.Models.Employee> list = new List<Employees.Models.Employee>();
for (int i = 0; i < 10; i++)
{
list.Append(new Employees.Models.Employee { Id = i, Name = "Emoployee"+i, Email = "abc"+i+"@gmail.com", OfficePhoneNumber = "12345678", BirthDate = DateTime.Now.AddYears(-18-i), IsActive = true, PreferredLanguage = "en" });
}
return (true, list, null);
}
public static async Task<(bool, Employees.Models.Employee, string)> getOkResponse(int Id)
{
var Employees = await getOkResponse();
var Employee = Employees.Item2.FirstOrDefault(s => s.Id == Id);
return (true, Employee, null);
}
public static async Task<(bool, Employees.Models.Employee, string)> getBadRequestResponse()
{
return (false, null, "Bad Request");
}
public static async Task<(bool, Models.Employee, string)> getNotFoundResponse()
{
return (false, null, "Not Found");
}
public static async Task<(bool, IEnumerable<Models.Employee>, string)> getNoContentResponse()
{
IEnumerable<Employees.Models.Employee> list = new List<Employees.Models.Employee>();
return (false, list, null);
}
public static async Task<Models.Employee> getInputEmployeeData()
{
return new Models.Employee { Id = 1, Name = "ABC1", Email = "abc1@gmail.com", OfficePhoneNumber = "12345678", BirthDate = DateTime.Now.AddYears(-18), IsActive = true, PreferredLanguage = "en" };
}
}
}