Is there a way to change InstalledUICulture from English to Germany in test?
var groups = new ObservableDictionary<string, IGroupViewModel>(vm =>
vm.Name.ToString(CultureInfo.InstalledUICulture));
var isGroupExists = groups.ContainsKey(GroupName.ToString(CultureInfo.InstalledUICulture));
if (!isGroupExists)
{
groups.Add(new GroupViewModel());
}
Something like this. Instead of coupling your code directly to
CultureInfo.InstalledUICultureyou use a layer of indirection to allow you to pretend that the current UI culture is whatever you want.I don't know your classes or how you are creating services, but I've assumed some sort of DI and used constructor parameters for the provider (or service or whatever you want to call it)