-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,649 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 26 additions & 12 deletions
38
src/Orc.Controls.Tests/UI/Controls/ColorLegend/ColorLegendTestFacts.Selection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
namespace Orc.Controls.Tests.UI | ||
{ | ||
using NUnit.Framework; | ||
using Orc.Automation.Tests; | ||
namespace Orc.Controls.Tests.UI; | ||
|
||
using System; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using Orc.Automation.Tests; | ||
|
||
public partial class ColorLegendTestFacts | ||
public partial class ColorLegendTestFacts | ||
{ | ||
[Test] | ||
public void CorrectlySelectItem() | ||
{ | ||
[Test] | ||
public void CorrectlySelectItem() | ||
{ | ||
var target = Target; | ||
var target = Target; | ||
|
||
const int itemIndex = 2; | ||
|
||
var selectedItem = target.Items[itemIndex]; | ||
|
||
EventAssert.Raised(target, nameof(target.SelectionChanged), () => selectedItem.Select()); | ||
|
||
var model = target.Current; | ||
|
||
var selectedSourceItems = (model.ItemsSource ?? Array.Empty<IColorLegendItem>()) | ||
.Where(x => x.IsSelected) | ||
.ToArray(); | ||
|
||
const int itemIndex = 2; | ||
Assert.That(selectedSourceItems, Has.Length.EqualTo(1)); | ||
|
||
EventAssert.Raised(target, nameof(target.SelectionChanged), () => target.Items[itemIndex].Select()); | ||
} | ||
var selectedItemData = selectedSourceItems.Single(); | ||
Assert.That(selectedItem.Description, Is.EqualTo(selectedItemData.Description)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.