public void ApkAanvraagLogRepositoryFindAllTest() { // Arrange - Act using (var repo = new ApkAanvraagLogRepository(new RdwContext(_options))) { var apkAanvraagLog1 = new ApkAanvraagLog() { CorrelationId = Guid.NewGuid().ToString(), RequestMessage = "RequestMessage 1", ResponseMessage = "ResponseMessage 1" }; repo.Insert(apkAanvraagLog1); var apkAanvraagLog2 = new ApkAanvraagLog() { CorrelationId = Guid.NewGuid().ToString(), RequestMessage = "RequestMessage 2", ResponseMessage = "ResponseMessage 2" }; repo.Insert(apkAanvraagLog2); } // Assert using (var repo = new ApkAanvraagLogRepository(new RdwContext(_options))) { Assert.AreEqual(2, repo.Count()); } }
private string LogAndSendRequest(ApkKeuringsverzoekRequestMessage apkKeuringsVerzoek) { var requestMessage = ConvertRequestToXML(apkKeuringsVerzoek); var requestLog = new ApkAanvraagLog(); // log request requestLog.CorrelationId = apkKeuringsVerzoek.Keuringsverzoek.CorrelatieId; requestLog.RequestMessage = requestMessage; _apkAanvraagLogRepository.Insert(requestLog); // make request var responseMessage = _rdwApkAgent.SendApkKeuringsVerzoek(requestMessage); // log respone requestLog.ResponseMessage = responseMessage; _apkAanvraagLogRepository.Update(requestLog); return(responseMessage); }
public void ApkAanvraagLogRepositoryDeleteTest() { // Arrange using (var repo = new ApkAanvraagLogRepository(new RdwContext(_options))) { var apkAanvraagLog = new ApkAanvraagLog() { CorrelationId = Guid.NewGuid().ToString(), RequestMessage = "RequestMessage", ResponseMessage = "ResponseMessage" }; // Act repo.Insert(apkAanvraagLog); repo.Delete(1); } // Assert using (var repo = new ApkAanvraagLogRepository(new RdwContext(_options))) { Assert.AreEqual(0, repo.Count()); } }