using DamageAssesment.Api.DocuLinks.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net.Mail; using System.Text; using System.Threading.Tasks; namespace DamageAssesment.Api.DocuLinks.Test { public class MockData { public static async Task<(bool, List, string)> getOkResponses() { 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 DocuLinksTranslations = new List(); DocuLinksTranslations.Add(new DoculinkTranslation() { Language = "en", title = "tel"+i, description = "Sample"+i }); List doclinksAttachments = new List(); doclinksAttachments.Add(new DoculinkAttachments() { docName = "",Path="www.google.com", IsAttachments=false,CustomOrder=1 }); list.Add(new DocuLinks.Models.ResDoculink() { Id = i, linkTypeId = i, IsActive = true, titles= dicttitle, description=dictdesc, CustomOrder=i, doclinksAttachments= doclinksAttachments }); } // List doculinks = list.GroupBy(a => a.linkTypeId).Select(a => new ResDoculinks() { linkTypeId = a.Key, doculinks = a.ToList() }).ToList(); return (true, list, null); } 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 DocuLinksTranslations = new List(); DocuLinksTranslations.Add(new DoculinkTranslation() { Language = "en", title = "tel" + i, description = "Sample" + i }); List doclinksAttachments = new List(); doclinksAttachments.Add(new DoculinkAttachments() { docName = "", Path = "www.google.com", IsAttachments = false, CustomOrder = 1 }); list.Add(new DocuLinks.Models.ResDoculink() { Id = i, linkTypeId = i, IsActive = true, titles = dicttitle, description = dictdesc, CustomOrder = i, doclinksAttachments = doclinksAttachments }); } return (true, list, null); } public static async Task<(bool, DocuLinks.Models.ResDoculink, string)> getOkResponse(int Id) { var DocuLinks = await getOkResponse(); var Document = DocuLinks.Item2.FirstOrDefault(s => s.Id == Id); return (true, Document, null); } public static async Task<(bool, DocuLinks.Models.ResDoculink, string)> getBadRequestResponse() { return (false, null, "Bad Request"); } public static async Task<(bool, DocuLinks.Models.ResDoculink, string)> getNotFoundResponse() { return (false, null, "Not Found"); } public static async Task<(bool, IEnumerable, string)> getNoContentResponses() { IEnumerable list = new List(); return (false, list, null); } public static async Task<(bool, IEnumerable, string)> getNoContentResponse() { IEnumerable list = new List(); return (false, list, null); } public static async Task GetDocuLinksInfo(int id) { List fileModels = new List(); fileModels.Add( new FileModel() { FileName = "Sample", FileContent = "c2FtcGxl", FileExtension = ".txt",IsAttachments=true,CustomOrder=1 }); return new ReqDoculink() { Id=id, linkTypeId = 1, CustomOrder = 1, Files = fileModels }; } public static async Task getInputDocumentData() { List DocuLinksTranslations = new List(); DocuLinksTranslations.Add(new DoculinkTranslation() { Language = "en", title = "tel", description = "Sample" }); List doclinksAttachments = new List(); doclinksAttachments.Add(new DoculinkAttachments() { docName = "", Path = "www.google.com", IsAttachments = false, CustomOrder = 1 }); return new Models.Doculink { Id = 1, linkTypeId = 1, IsActive = true, CustomOrder=1, documentsTranslations = DocuLinksTranslations, doclinksAttachments= doclinksAttachments }; } public static async Task> getInputDocuLinksData() { List DocuLinksTranslations = new List(); DocuLinksTranslations.Add(new DoculinkTranslation() { Language = "en", title = "tel", description = "Sample" }); List doclinksAttachments = new List(); doclinksAttachments.Add(new DoculinkAttachments() { docName = "", Path = "www.google.com", IsAttachments = false, CustomOrder = 1 }); List DocuLinks = new List(); DocuLinks.Add(new Models.Doculink { Id = 1, linkTypeId = 1, IsActive = true, CustomOrder = 1, documentsTranslations = DocuLinksTranslations, doclinksAttachments = doclinksAttachments }); return DocuLinks; } } }