public async void Create_ShallReturnBadRequestWithBadJobProcessType() { var aeTitle = "TOOOOOOOOOOOOOOOOOOOOOOOLONG"; var claraAeTitle = new DestinationApplicationEntity { Name = aeTitle, AeTitle = aeTitle, HostIp = "host", Port = 1 }; var result = await _controller.Create(claraAeTitle); var objectResult = result.Result as ObjectResult; Assert.NotNull(objectResult); var problem = objectResult.Value as ProblemDetails; Assert.NotNull(problem); Assert.Equal("Validation error.", problem.Title); Assert.Equal($"'{aeTitle}' is not a valid AE Title (source: DestinationApplicationEntity).", problem.Detail); Assert.Equal((int)HttpStatusCode.BadRequest, problem.Status); }
public async void Create_ShallReturnServiceUnavailableWHenCrdIsDisabled() { var claraAeTitle = new DestinationApplicationEntity { Name = "AETITLE", AeTitle = "AET", HostIp = "localhost", Port = 104 }; _configuration.Value.ReadAeTitlesFromCrd = false; var result = await _controller.Create(claraAeTitle); Assert.NotNull(result); var objectResult = result.Result as ObjectResult; Assert.NotNull(objectResult); var problem = objectResult.Value as ProblemDetails; Assert.NotNull(problem); Assert.Equal("Reading AE Titles from Kubernetes CRD is not enabled.", problem.Title); Assert.Equal(503, problem.Status); }