public static MemorySettingsStorage Create([PexAssumeUnderTest]String[] settingNames, [PexAssumeNotNull] Object[] settingValues)
        {
            PexAssume.IsTrue(settingNames.Length == settingValues.Length);
            PexAssume.IsTrue(settingNames.Length > 0);

            MemorySettingsStorage memorySettingsStorage = new MemorySettingsStorage();
            for (int count = 0; count < settingNames.Length; count++)
            {
                PexAssume.IsTrue(settingValues[count] is string || settingValues[count] is int || settingValues[count] is bool);
                memorySettingsStorage.SaveSetting(settingNames[count], settingValues[count]);
            }
            return memorySettingsStorage;
        }
Example #2
0
        public static MemorySettingsStorage Create([PexAssumeUnderTest] String[] settingNames, [PexAssumeUnderTest] Object[] settingValues)
        {
            PexAssume.IsTrue(settingNames.Length == settingValues.Length);
            PexAssume.IsTrue(settingNames.Length > 0);

            MemorySettingsStorage memorySettingsStorage = new MemorySettingsStorage();

            for (int count = 0; count < settingNames.Length; count++)
            {
                PexAssume.IsTrue(settingValues[count] is string || settingValues[count] is int || settingValues[count] is bool || settingValues[count] is Enum);
                memorySettingsStorage.SaveSetting(settingNames[count], settingValues[count]);
            }
            return(memorySettingsStorage);
        }
 public void SubGroupSettingsPUT204()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       MemorySettingsStorage memorySettingsStorage = new MemorySettingsStorage();
       settingsGroup = new SettingsGroup((ISettingsStorage)memorySettingsStorage);
       disposables.Add((IDisposable)settingsGroup);
       object s0 = new object();
       this.SubGroupSettingsPUT2(settingsGroup, "", s0);
       disposables.Dispose();
       PexAssert.IsNotNull((object)settingsGroup);
       PexAssert.IsNull(settingsGroup.Storage);
     }
 }
Example #4
0
        public static SettingsGroup Create([PexAssumeUnderTest]String[] settingNames, [PexAssumeUnderTest] Object[] settingValues)
        {
            PexAssume.IsTrue(settingNames.Length == settingValues.Length);
            PexAssume.IsTrue(settingNames.Length > 0);

            MemorySettingsStorage storage = new MemorySettingsStorage();
            SettingsGroup settingsGroup = new SettingsGroup(storage);

            for (int count = 0; count < settingNames.Length; count++)
            {
                PexAssume.IsTrue(settingValues[count] is string || settingValues[count] is int || settingValues[count] is bool || settingValues[count] is Enum);
                //PexAssume.IsTrue(settingNames[count] != null && !settingNames[count].Equals(""));
                settingsGroup.SaveSetting(settingNames[count], settingValues[count]);
            }

            return settingsGroup;
        }
Example #5
0
        public static SettingsGroup Create([PexAssumeUnderTest] String[] settingNames, [PexAssumeUnderTest] Object[] settingValues)
        {
            PexAssume.IsTrue(settingNames.Length == settingValues.Length);
            PexAssume.IsTrue(settingNames.Length > 0);

            MemorySettingsStorage storage       = new MemorySettingsStorage();
            SettingsGroup         settingsGroup = new SettingsGroup(storage);

            for (int count = 0; count < settingNames.Length; count++)
            {
                PexAssume.IsTrue(settingValues[count] is string || settingValues[count] is int || settingValues[count] is bool || settingValues[count] is Enum);
                //PexAssume.IsTrue(settingNames[count] != null && !settingNames[count].Equals(""));
                settingsGroup.SaveSetting(settingNames[count], settingValues[count]);
            }

            return(settingsGroup);
        }
Example #6
0
 public void Init()
 {
     MemorySettingsStorage storage = new MemorySettingsStorage();
     formSettings = new UserSettings( storage ).Form;
 }
 public void BadSettingPUT120()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       MemorySettingsStorage memorySettingsStorage = new MemorySettingsStorage();
       settingsGroup = new SettingsGroup((ISettingsStorage)memorySettingsStorage);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT1
           (settingsGroup, "\u001a\b3\u0100o@\0", "\u001a\b3\u0100o@\0", 0);
       disposables.Dispose();
       PexAssert.IsNotNull((object)settingsGroup);
       PexAssert.IsNull(settingsGroup.Storage);
     }
 }