public void Test_mapper_complex() { /// ProcessHistoryRepository processHistoryRepository = new ProcessHistoryRepository(null, new DowntimeRepositoryMapper()); var mapper = new DowntimeRepositoryMapper(); var id = Guid.NewGuid(); var interruptionId = 23; var item = new ProcessHistoryModel { Id = id, FinishProcessDateTime = DateTime.Now, StartProcessDateTime = DateTime.Now.AddMinutes(-1), Interruption = new InterruptionHistoryModel { Id = interruptionId, StartDateTime = DateTime.Now.AddSeconds(-10), EndDateTime = DateTime.Now }, ProductSpecification = new ProductSpecificationModel { Code = "Codio1", StandarDuration = 3 } }; var entity = mapper.Map <ProcessHistory>(item); var newItem = mapper.Map <ProcessHistoryModel>(entity); Assert.AreEqual(id, newItem.Id); Assert.AreEqual(interruptionId, newItem.Interruption.Id); Assert.AreEqual(item.StartProcessDateTime, newItem.StartProcessDateTime); Assert.AreEqual("Codio1", newItem.ProductSpecification.Code); Assert.AreEqual(3, newItem.ProductSpecification.StandarDuration); }
public ProcessHistoryRepository(ProcessHistoryUnitOfWork processHistoryUnitOfWork, DowntimeRepositoryMapper mapper, TableQueryFactory tableQuery) { this.processHistoryUnitOfWork = processHistoryUnitOfWork; this.mapper = mapper; this.tableQuery = tableQuery; }
public Startup(IDowntimeRepository repository, DowntimeRepositoryMapper mapper, ILogger <Startup> logger) { this.repository = repository; this.mapper = mapper; this.logger = logger; logger.LogInformation("Hola mundo info"); logger.LogError("Hola mundo error"); logger.LogWarning("Hola mundo warning"); }
public void Test_mapper_simple() { /// ProcessHistoryRepository processHistoryRepository = new ProcessHistoryRepository(null, new DowntimeRepositoryMapper()); var mapper = new DowntimeRepositoryMapper(); var item = new ProcessHistoryModel { Id = Guid.NewGuid(), FinishProcessDateTime = DateTime.Now, StartProcessDateTime = DateTime.Now.AddMinutes(-1) }; var entity = mapper.Map <ProcessHistory>(item); var newItem = mapper.Map <ProcessHistoryModel>(entity); Assert.AreEqual(item.Id, newItem.Id); Assert.AreEqual(item.StartProcessDateTime, newItem.StartProcessDateTime); }
public ProcessHistoryRepositoryCache(DowntimeRepositoryMapper mapper) { this.mapper = mapper; }