Create methods for test and demo use. Can also use temporarily in Libation until migration is complete

This commit is contained in:
Robert McRackan 2020-08-19 15:42:54 -04:00
parent 09dbc67914
commit 57302e1b5c
2 changed files with 11 additions and 1 deletions

View File

@ -19,9 +19,19 @@ namespace InternalUtilities
_ = new AccountsPersister(new Accounts(), AccountsSettingsFile);
}
// convenience for for tests and demos. don't use in production Libation
public static Account TEST_GetFirstAccount()
=> new AccountsPersister(AccountsSettingsFile).Accounts.GetAll().FirstOrDefault();
// convenience for for tests and demos. don't use in production Libation
public static string TEST_GetFirstIdentityTokensJsonPath()
=> TEST_GetFirstAccount().GetIdentityTokensJsonPath();
// TEMP
public static string GetIdentityTokensJsonPath() => null;
public static string GetIdentityTokensJsonPath(this Account account)
=> GetIdentityTokensJsonPath(account.AccountId, account?.IdentityTokens?.Locale.Name);
public static string GetIdentityTokensJsonPath(string username, string locale)
{
var usernameSanitized = JsonConvert.ToString(username);

View File

@ -13,7 +13,7 @@
<!-- <PublishSingleFile>true</PublishSingleFile> -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Version>3.1.12.123</Version>
<Version>3.1.12.127</Version>
</PropertyGroup>
<ItemGroup>