public void MatchOneEndWildcard() { var accounts = new[] { new Account { ProfilePatterns = "Hello*" }, new Account { ProfilePatterns = "Dont match" }, }; var profile = new Profile { Name = "Hello world" }; var matchedAccounts = _profileAccountsGetter.GetAccountsForProfile(profile, accounts); Assert.AreEqual(1, matchedAccounts.Length, "Only one account should match"); Assert.AreEqual("Hello*", matchedAccounts[0].ProfilePatterns); }
public void StartGame(Profile profile) { var matchedAccounts = _profileAccountsGetter.GetAccountsForProfile(profile, GlobalConfig.Accounts.ToArray()); // If no accounts then just start the game if (matchedAccounts.Length == 0) { _gameStarter.Start(profile, GlobalConfig, null); return; } // Otherwise select account _navigationServices.Main.NavigateToViewModel <SelectAccountViewModel>(new Dictionary <string, object> { [nameof(SelectAccountViewModel.Accounts)] = matchedAccounts, [nameof(SelectAccountViewModel.OnAccountSelect)] = (Action <Account>)(account => _gameStarter.Start(profile, GlobalConfig, account)) }); }