Exemple #1
0
        public void ConfigurationSerialization()
        {
            var config = new UpdateManagerConfiguration()
            {
                DownloadSourcePath  = DOWNLOAD_SOURCE_PATH_S,
                SignatureSourcePath = SIGNATURE_SOURCE_PATH_S
            };

            //save to a temp file.
            var tempFile = Path.GetTempFileName();

            Assert.DoesNotThrow(() => config.Save(tempFile, null));

            //read from a temp file.
            UpdateManagerConfiguration savedConfig = null;

            Assert.DoesNotThrow(() => savedConfig = UpdateManagerConfiguration.Load(tempFile, null));

            //Compare parameters.
            Assert.IsNotNull(savedConfig);
            Assert.AreEqual(config.CheckNewerDailyBuild, savedConfig.CheckNewerDailyBuild);
            Assert.AreEqual(config.SignatureSourcePath, savedConfig.SignatureSourcePath);
            Assert.AreEqual(config.DownloadSourcePath, savedConfig.DownloadSourcePath);
            Assert.AreEqual(config.ForceUpdate, savedConfig.ForceUpdate);
            Assert.AreEqual(config.DisableUpdates, savedConfig.DisableUpdates);
        }
Exemple #2
0
 public void UpdateManagerConfigurationLoadTest()
 {
     Assert.IsNull(UpdateManagerConfiguration.Load(null, updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load("", updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load("filePath", updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load(Path.GetTempFileName(), updateManager));
 }
Exemple #3
0
 public void UpdateManagerConfigurationLoadTest()
 {
     //Testing all the calls for Load that return null
     Assert.IsNull(UpdateManagerConfiguration.Load(null, updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load("", updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load("filePath", updateManager));
     Assert.IsNull(UpdateManagerConfiguration.Load(Path.GetTempFileName(), updateManager));
 }