Exemplo n.º 1
0
        public void should_Send_Mgs()
        {
            _sendService.Client = new HttpClient(_mpiHandlerMock.Object);
            var sendTo = new SendManifestPackageDTO(_registry);

            var responses = _sendService.SendMigrationsAsync(sendTo).Result;

            Assert.NotNull(responses);
            Assert.False(responses.Select(x => x.IsValid()).Any(x => false));
            responses.ForEach(sendMpiResponse => Log.Debug($"SENT! > {sendMpiResponse}"));
        }
Exemplo n.º 2
0
 public IActionResult SendMigrationExtracts([FromBody] SendManifestPackageDTO packageDto)
 {
     if (!packageDto.IsValid())
     {
         return(BadRequest());
     }
     try
     {
         _mgsSendService.SendMigrationsAsync(packageDto);
         return(Ok());
     }
     catch (Exception e)
     {
         var msg = $"Error sending Extracts {e.Message}";
         Log.Error(e, msg);
         return(StatusCode(500, msg));
     }
 }