XamlLoadPermission(IEnumerable<XamlLoadAccess>) duplicates all items in the array
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
```cs
public static IEnumerable Ctor_XamlAccessLevels_TestData()
{
yield return new object[] { new XamlAccessLevel[0] };
yield return new object[] { new XamlAccessLevel[] { XamlAccessLevel.PrivateAccessTo(typeof(int)) } };
yield return new object[] { new XamlAccessLevel[] { XamlAccessLevel.PrivateAccessTo(typeof(int)), XamlAccessLevel.PrivateAccessTo(typeof(int)) } };
}
[Theory]
[MemberData(nameof(Ctor_XamlAccessLevels_TestData))]
public void Ctor_XamlAccessLevels(IEnumerable allowedAccess)
{
var permission = new XamlLoadPermission(allowedAccess);
Assert.False(permission.IsUnrestricted());
Assert.Equal(allowedAccess.Length, permission.AllowedAccess.Count);
}
```
Expected: the count of `permission.AllowedAccess` is equal to the count of the input array.
Actual: the count of `permission.AllowedAccess` is *double* the count of the input array
Contributor guide
Assessment
This issue has not been assessed yet.