public IActionResult Post(KeyVaultSecretAddEvent @event) { try { if (@event.NewVersion) { return(Ok(_adder.StoreUpdatedSecretToVault(@event.Name, @event.Value))); } return(Created("", _adder.StoreSecretToVault(@event.Name, @event.Value))); } catch (Exception e) { Console.WriteLine(e); return(NotFound(e.Message)); } }
public void StoreSecretToVault_ReturnsString() { _adder.StoreSecretToVault(SecretName, "secretStored!").Should().Be("The secret has been successfully added."); }