forked from MDCPS/DamageAssessment_Backend
314: updated document multi language output format
This commit is contained in:
@ -11,12 +11,16 @@ namespace DamageAssesment.Api.Documents.Test
|
||||
public class MockData
|
||||
{
|
||||
|
||||
public static async Task<(bool, List<Documents.Models.Document>, string)> getOkResponse()
|
||||
public static async Task<(bool, List<Documents.Models.MultiLanDocument>, string)> getOkResponse()
|
||||
{
|
||||
List<Documents.Models.Document> list = new List<Documents.Models.Document>();
|
||||
List<Documents.Models.MultiLanDocument> list = new List<Documents.Models.MultiLanDocument>();
|
||||
|
||||
for (int i = 1; i < 4; i++)
|
||||
{
|
||||
Dictionary<string, string> dicttitle = new Dictionary<string, string>();
|
||||
Dictionary<string, string> dictdesc = new Dictionary<string, string>();
|
||||
dicttitle.Add("en", "test"); dicttitle.Add("fr", "tester");
|
||||
dictdesc.Add("en", "test"); dictdesc.Add("fr", "tester");
|
||||
List<Documents.Models.DocumentsTranslation> documentsTranslations = new List<DocumentsTranslation>();
|
||||
documentsTranslations.Add(new DocumentsTranslation()
|
||||
{
|
||||
@ -24,7 +28,7 @@ namespace DamageAssesment.Api.Documents.Test
|
||||
title = "tel"+i,
|
||||
description = "Sample"+i
|
||||
});
|
||||
list.Add(new Documents.Models.Document()
|
||||
list.Add(new Documents.Models.MultiLanDocument()
|
||||
{
|
||||
|
||||
Id = i,
|
||||
@ -33,32 +37,33 @@ namespace DamageAssesment.Api.Documents.Test
|
||||
url = "testurl" + i,
|
||||
Path = "testpath" + i,
|
||||
IsActive = true,
|
||||
documentsTranslations= documentsTranslations,
|
||||
titles= dicttitle,
|
||||
description=dictdesc,
|
||||
dateCreated = DateTime.Now,
|
||||
dateUpdated = DateTime.Now
|
||||
});
|
||||
}
|
||||
return (true, list, null);
|
||||
}
|
||||
public static async Task<(bool, Documents.Models.Document, string)> getOkResponse(int Id)
|
||||
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.Document, string)> getBadRequestResponse()
|
||||
public static async Task<(bool, Documents.Models.MultiLanDocument, string)> getBadRequestResponse()
|
||||
{
|
||||
return (false, null, "Bad Request");
|
||||
}
|
||||
|
||||
public static async Task<(bool, Documents.Models.Document, string)> getNotFoundResponse()
|
||||
public static async Task<(bool, Documents.Models.MultiLanDocument, string)> getNotFoundResponse()
|
||||
{
|
||||
return (false, null, "Not Found");
|
||||
}
|
||||
public static async Task<(bool, IEnumerable<Documents.Models.Document>, string)> getNoContentResponse()
|
||||
public static async Task<(bool, IEnumerable<Documents.Models.MultiLanDocument>, string)> getNoContentResponse()
|
||||
{
|
||||
IEnumerable<Documents.Models.Document> list = new List<Documents.Models.Document>();
|
||||
IEnumerable<Documents.Models.MultiLanDocument> list = new List<Documents.Models.MultiLanDocument>();
|
||||
return (false, list, null);
|
||||
}
|
||||
public static async Task<Documents.Models.DocumentInfo> GetDocumentsInfo(int id)
|
||||
|
Reference in New Issue
Block a user