Skip to content

Commit

Permalink
[Refactor] Enumerable methods on indexable collections (SQ improvement)
Browse files Browse the repository at this point in the history
  • Loading branch information
samatstariongroup committed Dec 10, 2024
1 parent a6d5071 commit 364bada
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ public void VerifyWithIterationIdParameter()

Assert.Multiple(() =>
{
Assert.That(renderer.Instance.IterationId, Is.EqualTo(this.openIterations.Items.First().Iid));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items.First()), Times.Once);
Assert.That(renderer.Instance.IterationId, Is.EqualTo(this.openIterations.Items[0].Iid));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items[0]), Times.Once);
});

this.viewModel.Setup(x => x.SelectedThing).Returns((Iteration)null);
_ = this.context.RenderComponent<SingleIterationApplicationTemplate>(parameters => { parameters.Add(p => p.IterationId, this.openIterations.Items.First().Iid); });

this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items.First()), Times.Exactly(2));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items[0]), Times.Exactly(2));

this.viewModel.Setup(x => x.SelectedThing).Returns(new Iteration
{
Expand All @@ -147,7 +147,7 @@ public void VerifyWithIterationIdParameter()
Assert.Multiple(() =>
{
Assert.That(renderer.Instance.IterationId, Is.EqualTo(this.viewModel.Object.SelectedThing.Iid));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items.First()), Times.Exactly(2));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items[0]), Times.Exactly(2));
});
}

Expand Down Expand Up @@ -181,10 +181,10 @@ public void VerifyWithoutIterationIdParameter()
Assert.Multiple(() =>
{
Assert.That(navigationManager.Uri, Is.EqualTo("http://localhost/"));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items.First()), Times.Exactly(2));
this.viewModel.Verify(x => x.OnThingSelect(this.openIterations.Items[0]), Times.Exactly(2));
});

this.viewModel.Setup(x => x.SelectedThing).Returns(this.openIterations.Items.First());
this.viewModel.Setup(x => x.SelectedThing).Returns(this.openIterations.Items[0]);
renderer.Instance.SetCorrectUrl();
var iteration = this.viewModel.Object.SelectedThing;

Expand Down

0 comments on commit 364bada

Please sign in to comment.