|
|
@ -25,8 +25,8 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[MemberData("AllIptcTags")] |
|
|
[MemberData(nameof(AllIptcTags))] |
|
|
public void IptcProfile_SetValue_WithStrictOption_Works(IptcTag tag) |
|
|
public void IptcProfile_SetValue_WithStrictEnabled_Works(IptcTag tag) |
|
|
{ |
|
|
{ |
|
|
// arrange
|
|
|
// arrange
|
|
|
var profile = new IptcProfile(); |
|
|
var profile = new IptcProfile(); |
|
|
@ -41,6 +41,23 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
Assert.Equal(expectedLength, actual.Value.Length); |
|
|
Assert.Equal(expectedLength, actual.Value.Length); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[MemberData(nameof(AllIptcTags))] |
|
|
|
|
|
public void IptcProfile_SetValue_WithStrictDisabled_Works(IptcTag tag) |
|
|
|
|
|
{ |
|
|
|
|
|
// arrange
|
|
|
|
|
|
var profile = new IptcProfile(); |
|
|
|
|
|
var value = new string('s', tag.MaxLength() + 1); |
|
|
|
|
|
var expectedLength = value.Length; |
|
|
|
|
|
|
|
|
|
|
|
// act
|
|
|
|
|
|
profile.SetValue(tag, value, false); |
|
|
|
|
|
|
|
|
|
|
|
// assert
|
|
|
|
|
|
IptcValue actual = profile.GetValues(tag).First(); |
|
|
|
|
|
Assert.Equal(expectedLength, actual.Value.Length); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[InlineData(IptcTag.DigitalCreationDate)] |
|
|
[InlineData(IptcTag.DigitalCreationDate)] |
|
|
[InlineData(IptcTag.ExpirationDate)] |
|
|
[InlineData(IptcTag.ExpirationDate)] |
|
|
@ -199,13 +216,6 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
ContainsIptcValue(iptcValues, IptcTag.Caption, expectedCaption); |
|
|
ContainsIptcValue(iptcValues, IptcTag.Caption, expectedCaption); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void IptcProfile_SetNewValue_RespectsMaxLength() |
|
|
|
|
|
{ |
|
|
|
|
|
// arrange
|
|
|
|
|
|
var profile = new IptcProfile(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[InlineData(IptcTag.ObjectAttribute)] |
|
|
[InlineData(IptcTag.ObjectAttribute)] |
|
|
[InlineData(IptcTag.SubjectReference)] |
|
|
[InlineData(IptcTag.SubjectReference)] |
|
|
@ -292,7 +302,7 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void IptcProfile_RemoveByTag_RemovesAllEntrys() |
|
|
public void IptcProfile_RemoveByTag_RemovesAllEntrys() |
|
|
{ |
|
|
{ |
|
|
// arange
|
|
|
// arrange
|
|
|
var profile = new IptcProfile(); |
|
|
var profile = new IptcProfile(); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
@ -308,7 +318,7 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void IptcProfile_RemoveByTagAndValue_Works() |
|
|
public void IptcProfile_RemoveByTagAndValue_Works() |
|
|
{ |
|
|
{ |
|
|
// arange
|
|
|
// arrange
|
|
|
var profile = new IptcProfile(); |
|
|
var profile = new IptcProfile(); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
@ -322,9 +332,9 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.IPTC |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void IptcProfile_GetValue_RetrievesAllEntrys() |
|
|
public void IptcProfile_GetValue_RetrievesAllEntries() |
|
|
{ |
|
|
{ |
|
|
// arange
|
|
|
// arrange
|
|
|
var profile = new IptcProfile(); |
|
|
var profile = new IptcProfile(); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
profile.SetValue(IptcTag.Byline, "test2"); |
|
|
|