DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Employees.Test/MockData.cs
2023-08-15 23:52:30 -04:00

54 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 = "Emp"+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(string 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, Employees.Models.Employee, string)> getNotFoundResponse()
{
return (false, null, "Not Found");
}
public static async Task<(bool, IEnumerable<Employees.Models.Employee>, string)> getNoContentResponse()
{
IEnumerable<Employees.Models.Employee> list = new List<Employees.Models.Employee>();
return (false, list, null);
}
public static async Task<Employees.Db.Employee> getInputEmployeeData()
{
return new Employees.Db.Employee { Id = "Emp1", Name = "ABC1", Email = "abc1@gmail.com", OfficePhoneNumber = "12345678", BirthDate = DateTime.Now.AddYears(-18), IsActive = true, PreferredLanguage = "en" };
}
}
}