Пример #1
0
        public void TestSaveAndLoad()
        {
            var saved = GetPasswordSettings();

            Persistence.Save(saved);

            PasswordSettingsTest loaded = Persistence.Load <PasswordSettingsTest>();

            Assert.IsNotNull(loaded);
            Assert.AreEqual(saved.Length, loaded.Length);
            Assert.AreEqual(saved.ForceEach, loaded.ForceEach);
        }
Пример #2
0
        private static PasswordSettingsTest GetPasswordSettings()
        {
            var result = new PasswordSettingsTest
            {
                Length                   = 12,
                ForceEach                = true,
                IncludeNumeric           = true,
                IncludeAlphaLower        = true,
                IncludeAlphaUpper        = true,
                IncludeSymbolSetNormal   = true,
                IncludeSymbolSetExtended = true
            };

            return(result);
        }