I'm using this nice lib as my setting handler, the problem is that as there is no interface, I cannot mock it (e.g. to verify if some items are changing with specific data).
also after changing the class that is auto-generated to code below, I couldn't inject it to my project :((
I'm using this nice lib as my setting handler, the problem is that as there is no interface, I cannot mock it (e.g. to verify if some items are changing with specific data).
also after changing the class that is auto-generated to code below, I couldn't inject it to my project :((
`public class Settings : IAppSettings { private static ISettings AppSetting => CrossSettings.Current;
And IAppSetting.cs:
public interface IAppSettings { void SetValue(string key, int value); void SetValue(string key, string value); void SetValue(string key, float value); void SetValue(string key, long value); void SetValue(string key, bool value); void SetValue(string key, decimal value); int GetValue(string key, int defaultValue); string GetValue(string key, string defaultValue); float GetValue(string key, float defaultValue); long GetValue(string key, long defaultValue); bool GetValue(string key, bool defaultValue); decimal GetValue(string key, decimal defaultValue); }
Now I can mock setting I wish in my tests and verify if methods are called with specific items.
thanks for your helpful lib :)