Skip to content

Commit c75df26

Browse files
committed
Assign Assert results to discard in unit test
Updated assertions in Test_RelayCommandAttribute_WithPartialCommandMethodDefinitions to assign results to the discard variable, improving code clarity and suppressing possible warnings about unused return values.
1 parent 4cc23d4 commit c75df26

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/CommunityToolkit.Mvvm.UnitTests/Test_RelayCommandAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ public void Test_RelayCommandAttribute_WithPartialCommandMethodDefinitions()
665665
{
666666
ModelWithPartialCommandMethods model = new();
667667

668-
Assert.IsInstanceOfType<RelayCommand>(model.FooCommand);
669-
Assert.IsInstanceOfType<RelayCommand<string>>(model.BarCommand);
670-
Assert.IsInstanceOfType<RelayCommand>(model.BazCommand);
671-
Assert.IsInstanceOfType<AsyncRelayCommand>(model.FooBarCommand);
668+
_ = Assert.IsInstanceOfType<RelayCommand>(model.FooCommand);
669+
_ = Assert.IsInstanceOfType<RelayCommand<string>>(model.BarCommand);
670+
_ = Assert.IsInstanceOfType<RelayCommand>(model.BazCommand);
671+
_ = Assert.IsInstanceOfType<AsyncRelayCommand>(model.FooBarCommand);
672672

673673
FieldInfo bazField = typeof(ModelWithPartialCommandMethods).GetField("bazCommand", BindingFlags.Instance | BindingFlags.NonPublic)!;
674674

0 commit comments

Comments
 (0)