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

54 lines
1.9 KiB
C#
Raw Permalink 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.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, Models.Employee, string)> getNotFoundResponse()
2023-08-15 22:52:30 -05:00
{
return (false, null, "Not Found");
}
public static async Task<(bool, IEnumerable<Models.Employee>, string)> getNoContentResponse()
2023-08-15 22:52:30 -05:00
{
IEnumerable<Employees.Models.Employee> list = new List<Employees.Models.Employee>();
return (false, list, null);
}
public static async Task<Models.Employee> getInputEmployeeData()
2023-08-15 22:52:30 -05:00
{
return new Models.Employee { Id = "Emp1", Name = "ABC1", Email = "abc1@gmail.com", OfficePhoneNumber = "12345678", BirthDate = DateTime.Now.AddYears(-18), IsActive = true, PreferredLanguage = "en" };
2023-08-15 22:52:30 -05:00
}
}
}