Esempio n. 1
0
        // private readonly Mock<SiteSetting> mockSetting;
        public SiteSettingTest()
        {
            mockReadConfig = new Mock <IReadConfig>();
            SettingFac <SiteSetting> .UpdateOrAddReadConfig(mockReadConfig.Object);

            mockReadConfig.Setup(q => q.Get("Test1", typeof(int))).Returns(32);
            mockReadConfig.Setup(q => q.Get("Test2", typeof(bool))).Returns(true);
            mockReadConfig.Setup(q => q.Get("Test3", typeof(string))).Returns("Test3");

            mockReadConfig.Setup(q => q.Get("Switch1", typeof(string))).Returns("HPN,GPG;APW");
            mockReadConfig.Setup(q => q.Get("Switch2", typeof(string))).Returns("HPN,GPG;APW");
        }
Esempio n. 2
0
 public static DataSetting GetSetting(string site)
 {
     return(SettingFac <DataSetting> .GetSetting(site));
 }
Esempio n. 3
0
 public static void GetOrUpdateSetting(string site)
 {
     SettingFac <DataSetting> .GetOrUpdateSetting(site);
 }
Esempio n. 4
0
 public static bool UpdateOrAddReadConfig(IReadConfig readConfig)
 {
     return(SettingFac <DataSetting> .UpdateOrAddReadConfig(readConfig));
 }
Esempio n. 5
0
 public static SiteSetting GetSetting(string site)
 {
     return(SettingFac <SiteSetting> .GetSetting(site));
 }