public void Publish(string key, string id, string version) { const string defaultMessage = "An error occurred when publishing the Package"; ValidateInputs(() => _serviceInputValidator.ValidateAllPackageKeys(key, id, version)); Action action = () => _packagePublisher.PublishPackage(key, id, version, PackageLogAction.Update); ExecuteAction(action, defaultMessage); }
public void ShouldEnsureThatGivenKeyCanAccessPackage() { const string key = "a key"; _packagePublisher.PublishPackage(key, EXISTING_PACKAGE_ID, EXISTING_PACKAGE_VERSION, LOG_ACTION); _mockedPackageAuthenticator.Verify(pa => pa.EnsureKeyCanAccessPackage(key, EXISTING_PACKAGE_ID, EXISTING_PACKAGE_VERSION), Times.Once(), "Should have made sure that the given key could access the given Package."); }