From 6a16a514243189d767b28964b9cc6efabc0f9022 Mon Sep 17 00:00:00 2001 From: Shimmy <2716316+weitzhandler@users.noreply.github.com> Date: Mon, 22 May 2023 06:50:29 +0100 Subject: [PATCH] test(mvux): implicit commands off and explicit command on test method --- .../Given_Methods_Then_GenerateCommands.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Uno.Extensions.Reactive.Tests/Generator/Given_Methods_Then_GenerateCommands.cs b/src/Uno.Extensions.Reactive.Tests/Generator/Given_Methods_Then_GenerateCommands.cs index 030bcdc2c0..a49e11141f 100644 --- a/src/Uno.Extensions.Reactive.Tests/Generator/Given_Methods_Then_GenerateCommands.cs +++ b/src/Uno.Extensions.Reactive.Tests/Generator/Given_Methods_Then_GenerateCommands.cs @@ -828,6 +828,13 @@ public async ValueTask AsyncWithParameter2(string myParameter) { } public void WithExplicitAttribute() { } } + public partial class When_ImplicitCommandEnabled_ViewModel + { + + [Reactive.Commands.Command(false)] + public void WithExplicitAttribute() { } + } + [TestMethod] public async Task When_ImplicitCommandDisabled_ViewModel_Then_CommandNotGenerated() { @@ -854,6 +861,15 @@ MemberInfo GetMember(string name) => typeof(BindableWhen_ImplicitCommandDisabled_ViewModel).GetMember(name, BindingFlags.Instance | BindingFlags.Public).Single(); } + [TestMethod] + public async Task When_ImplicitCommandEnabledAndUseExplicitAttribute_ViewModel_Then_CommandNotGenerated() + { + GetMember(nameof(When_ImplicitCommandEnabled_ViewModel.WithExplicitAttribute)).Should().NotBeNull().And.BeAssignableTo(); + + MemberInfo GetMember(string name) + => typeof(BindableWhen_ImplicitCommandEnabled_ViewModel).GetMember(name, BindingFlags.Instance | BindingFlags.Public).Single(); + } + [ImplicitFeedCommandParameters(false)] public partial class When_ImplicitFeedCommandDisabled_ViewModel {