Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
vplauzon committed Oct 21, 2023
1 parent b356825 commit 880f47f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text.Json;
using Xunit;
Expand Down Expand Up @@ -42,13 +43,16 @@ private void TestRestrictedViewPolicy(IEnumerable<string> tableNames, bool areEn
Assert.Equal(areEnabled, realCommand.AreEnabled);
Assert.Equal(tableNames.Count(), realCommand.TableNames.Count);

var zipped = tableNames
var expectedNames = ImmutableHashSet.Create(tableNames
.Select(t => GetActualTableName(t))
.Zip(realCommand.TableNames.Select(n => n.Name));
.ToArray());
var observedNames = ImmutableHashSet.Create(realCommand.TableNames
.Select(t => t.Name)
.ToArray());

foreach (var pair in zipped)
foreach (var name in expectedNames)
{
Assert.Equal(pair.First, pair.Second);
Assert.Contains(name, observedNames);
}
}

Expand Down

0 comments on commit 880f47f

Please sign in to comment.