using DamageAssesment.Api.Documents.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net.Mail; using System.Text; using System.Threading.Tasks; namespace DamageAssesment.Api.Documents.Test { public class MockData { public static async Task<(bool, List, string)> getOkResponse() { List list = new List(); for (int i = 1; i < 4; i++) { Dictionary dicttitle = new Dictionary(); Dictionary dictdesc = new Dictionary(); dicttitle.Add("en", "test"); dicttitle.Add("fr", "tester"); dictdesc.Add("en", "test"); dictdesc.Add("fr", "tester"); List documentsTranslations = new List(); documentsTranslations.Add(new DocumentsTranslation() { Language = "en", title = "tel"+i, description = "Sample"+i }); list.Add(new Documents.Models.MultiLanDocument() { Id = i, linkTypeId = i, docName = "sample"+i, url = "testurl" + i, Path = "testpath" + i, IsActive = true, titles= dicttitle, description=dictdesc, dateCreated = DateTime.Now, dateUpdated = DateTime.Now }); } return (true, list, null); } public static async Task<(bool, Documents.Models.MultiLanDocument, string)> getOkResponse(int Id) { var Documents = await getOkResponse(); var Document = Documents.Item2.FirstOrDefault(s => s.Id == Id); return (true, Document, null); } public static async Task<(bool, Documents.Models.MultiLanDocument, string)> getBadRequestResponse() { return (false, null, "Bad Request"); } public static async Task<(bool, Documents.Models.MultiLanDocument, string)> getNotFoundResponse() { return (false, null, "Not Found"); } public static async Task<(bool, IEnumerable, string)> getNoContentResponse() { IEnumerable list = new List(); return (false, list, null); } public static async Task GetDocumentsInfo(int id) { FileModel fileModel = new FileModel() { FileName = "Sample", FileContent = "c2FtcGxl", FileExtension = ".txt" }; return new DocumentInfo() { Id=id, linkTypeId = 1, url = "Sample", File = fileModel }; } public static async Task getInputDocumentData() { List documentsTranslations = new List(); documentsTranslations.Add(new DocumentsTranslation() { Language = "en", title = "tel", description = "Sample" }); return new Models.Document { Id = 1, linkTypeId = 1, docName = "sample", url = "testurl", Path = "testpath", IsActive = true, documentsTranslations= documentsTranslations, dateCreated = DateTime.Now, dateUpdated = DateTime.Now }; } public static async Task> getInputDocumentsData() { List documentsTranslations = new List(); documentsTranslations.Add(new DocumentsTranslation() { Language = "en", title = "tel", description="Sample" }); List Documents = new List(); Documents.Add(new Models.Document { Id = 1, linkTypeId = 1, docName = "sample", url = "testurl", Path = "testpath", IsActive = true, documentsTranslations= documentsTranslations, dateCreated = DateTime.Now, dateUpdated = DateTime.Now }); return Documents; } } }