Skip to content

Commit 95bca09

Browse files
committed
Test presence of non empty collections
1 parent b71fbf2 commit 95bca09

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

YamlDotNet.Test/Serialization/EmitDefaultValuesTests.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private class Model
5555
public Dictionary<string, string> AnEmptyDictionary => new Dictionary<string, string>();
5656
public IEnumerable<int> AnEmptyEnumerable => Enumerable.Empty<int>();
5757

58-
public string[] AnNonEmptyArray => new[] { "foo", "bar" };
59-
public IList<int> AnNonEmptyList => new List<int> { 6, 9, 42 };
58+
public string[] ANonEmptyArray => new[] { "foo", "bar" };
59+
public IList<int> ANonEmptyList => new List<int> { 6, 9, 42 };
6060
public IEnumerable<bool> ANonEmptyEnumerable => new[] { true, false };
6161
public Dictionary<string, string> ANonEmptyDictionary => new Dictionary<string, string>() { { "foo", "bar" } };
6262
}
@@ -163,6 +163,11 @@ public void Empty_enumerables_are_omitted_when_DefaultValuesHandling_is_OmitEmpt
163163
Assert.DoesNotContain(nameof(Model.AnEmptyList) + ':', yaml);
164164
Assert.DoesNotContain(nameof(Model.AnEmptyDictionary) + ':', yaml);
165165
Assert.DoesNotContain(nameof(Model.AnEmptyEnumerable) + ':', yaml);
166+
167+
Assert.Contains(nameof(Model.ANonEmptyArray) + ':', yaml);
168+
Assert.Contains(nameof(Model.ANonEmptyList) + ':', yaml);
169+
Assert.Contains(nameof(Model.ANonEmptyDictionary) + ':', yaml);
170+
Assert.Contains(nameof(Model.ANonEmptyEnumerable) + ':', yaml);
166171
}
167172

168173
[Fact]

0 commit comments

Comments
 (0)