itsp-services/pServer

Different internal and RestApi model for folder.

Ausm opened this issue · 0 comments

Ausm commented

Do not use the repository folder model for the ProtectedDataController:

public Task<Folder> GetFolderById(int? id)
{
return Task.FromResult(_repository.ProtectedDataRepository.GetFolderById(id));
}

If you do so, you can omit the id of the just requested folder, because there is no point in delivering the data you just provided.
In order to make it working you need to remove the two following asserts

Assert.AreEqual(token["id"].Value<int>(), 0);

Assert.AreEqual(token["id"].Value<int>(), 1);

You also can add values that does not exist in the repository folder model e.g. full qualified name etc.