private void CopyValueFromExistingManifest(JarManifestReader reader, string property) { if (jarManifestBuilder.TryGetValue(property, out string value)) { throw new InvalidOperationException( string.Format(System.Globalization.CultureInfo.CurrentCulture, UIResources.Builder_Error_ManifestPropertyShouldBeCopiedFromTemplate, property)); } jarManifestBuilder.SetProperty(property, reader.GetValue(property)); }
public void Get_MissingSetting_Throws() { // Arrange var text = @"Manifest-Version: 1.0"; var jarReader = new JarManifestReader(text); // Act Action act = () => jarReader.GetValue("missing-key"); // Assert act.Should().ThrowExactly <InvalidOperationException>().And.Message.Should().Be("The expected setting was not found in the manifest file: missing-key"); }