public void FindByEntityTheory(string idClient, string idEntity, bool match) { // arrange var file = new File { Client = new Client { Cid = idClient, Cuid = idEntity } }; var sut = new FindFileByEntity(IdClientToFound, IdEntityToFound); // assert Assert.Equal(match, sut.IsSatisfiedBy().Compile().Invoke(file)); }
public void FindByClientTheory(string initialDate, string finalDate, bool match) { // arrange var file = new File { LastUpdateTime = DateTime.Parse(DateUpdated) }; var sut = new FindFileByLastUpdateRange(DateTime.Parse(initialDate), DateTime.Parse(finalDate)); // assert Assert.Equal(match, sut.IsSatisfiedBy().Compile().Invoke(file)); }
public void FindByClientTheory(string idFile, bool match) { // arrange var file = new File { Type = new FileType { Id = idFile } }; var sut = new FindFileByType(IdToFound); // assert Assert.Equal(match, sut.IsSatisfiedBy().Compile().Invoke(file)); }
public void FindByClientTheory(string idFile, bool match) { // arrange var file = new File { Tags = new List<string> { TagToFound } }; var sut = new FindFileByTags(new List<string> { idFile }); // assert Assert.Equal(match, sut.IsSatisfiedBy().Compile().Invoke(file)); }
public void FindByClientTheory(string idFile, bool match) { // arrange var file = new File { FileId = new Guid(idFile) }; var sut = new FindFileById(new Guid(IdToFound)); // assert Assert.Equal(match, sut.IsSatisfiedBy().Compile().Invoke(file)); }
public void CreateResponseForFilesByCriteriaWithOutElements() { // arrange const int NumberOfFiles = 0; var repositoryMock = new Mock<IRepository<File>>(); var files = new List<File> { new File()}; repositoryMock.SetupIQueryable( files.AsQueryable()); var specficication = new Specification<File>(x => true); var file = new File(); var sut = new FileServiceBase { Repository = repositoryMock.Object }; // act var result = sut.CreateResponseForSingleFileByCriteria(file, specficication) as HttpResult; // assert //TODO REVIEW Assert.NotNull(result); Assert.Equal(result.StatusCode, HttpStatusCode.NotFound); }