Skip to content

Commit d01455e

Browse files
committed
Add unit test for build error reported in #13
1 parent 6465775 commit d01455e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/CommunityToolkit.Mvvm.UnitTests/Test_ICommandAttribute.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,30 @@ public async Task Test_ICommandAttribute_ConcurrencyControl_AsyncRelayCommandOfT
270270
Assert.IsTrue(model.AwaitForInputTaskCommand.CanExecute(null));
271271
}
272272

273+
// See https://github.com/CommunityToolkit/dotnet/issues/13
274+
[TestMethod]
275+
public void Test_ICommandAttribute_ViewModelRightAfterRegion()
276+
{
277+
ViewModelForIssue13 model = new();
278+
279+
Assert.IsNotNull(model.GreetCommand);
280+
Assert.IsInstanceOfType(model.GreetCommand, typeof(RelayCommand));
281+
}
282+
283+
#region Region
284+
public class Region
285+
{
286+
}
287+
#endregion
288+
289+
public partial class ViewModelForIssue13
290+
{
291+
[ICommand]
292+
private void Greet()
293+
{
294+
}
295+
}
296+
273297
public sealed partial class MyViewModel
274298
{
275299
public Task? ExternalTask { get; set; }

0 commit comments

Comments
 (0)