public virtual BOWorkerTaskLease MapEFToBO( WorkerTaskLease ef) { var bo = new BOWorkerTaskLease(); bo.SetProperties( ef.Id, ef.Exclusive, ef.JSON, ef.Name, ef.TaskId, ef.WorkerId); return(bo); }
public virtual WorkerTaskLease MapBOToEF( BOWorkerTaskLease bo) { WorkerTaskLease efWorkerTaskLease = new WorkerTaskLease(); efWorkerTaskLease.SetProperties( bo.Exclusive, bo.Id, bo.JSON, bo.Name, bo.TaskId, bo.WorkerId); return(efWorkerTaskLease); }
public void MapEFToBOList() { var mapper = new DALWorkerTaskLeaseMapper(); WorkerTaskLease entity = new WorkerTaskLease(); entity.SetProperties(true, "A", "A", "A", "A", "A"); List <BOWorkerTaskLease> response = mapper.MapEFToBO(new List <WorkerTaskLease>() { entity }); response.Count.Should().Be(1); }
public void MapEFToBO() { var mapper = new DALWorkerTaskLeaseMapper(); WorkerTaskLease entity = new WorkerTaskLease(); entity.SetProperties(true, "A", "A", "A", "A", "A"); BOWorkerTaskLease response = mapper.MapEFToBO(entity); response.Exclusive.Should().Be(true); response.Id.Should().Be("A"); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); response.TaskId.Should().Be("A"); response.WorkerId.Should().Be("A"); }
public void MapBOToEF() { var mapper = new DALWorkerTaskLeaseMapper(); var bo = new BOWorkerTaskLease(); bo.SetProperties("A", true, "A", "A", "A", "A"); WorkerTaskLease response = mapper.MapBOToEF(bo); response.Exclusive.Should().Be(true); response.Id.Should().Be("A"); response.JSON.Should().Be("A"); response.Name.Should().Be("A"); response.TaskId.Should().Be("A"); response.WorkerId.Should().Be("A"); }
public async void Get() { var mock = new ServiceMockFacade <IWorkerTaskLeaseRepository>(); var record = new WorkerTaskLease(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(record)); var service = new WorkerTaskLeaseService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.WorkerTaskLeaseModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLWorkerTaskLeaseMapperMock, mock.DALMapperMockFactory.DALWorkerTaskLeaseMapperMock); ApiWorkerTaskLeaseResponseModel response = await service.Get(default(string)); response.Should().NotBeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>())); }