public void ZipArrayTests() { var path = Utils.ClientBinPath; var mlMock = Mock.Create<MobileObservableCollection<string>>(); var dc = new DownloadCriteria(mlMock); if (!Directory.Exists(path)) Directory.CreateDirectory(path); if (!File.Exists(path + "\\file1")) File.Create(path + "\\file1").Close(); if (!File.Exists(path + "\\file2")) File.Create(path + "\\file2").Close(); dc.DownloadList.Add("file1"); dc.DownloadList.Add("file2"); dc.ZipName = "IamZipArchive.zip"; Utils.ZipArray(dc, Utils.ClientBinPath); Assert.IsTrue(File.Exists(path + "\\IamZipArchive.zip")); if (File.Exists(path + "\\file1")) File.Delete(path + "\\file1"); if (File.Exists(path + "\\file2")) File.Delete(path + "\\file2"); if (File.Exists(path + "\\IamZipArchive.zip")) File.Delete(path + "\\IamZipArchive.zip"); }
public void ConstructorWithParamsTest() { var mb = new MobileObservableCollection<string>(); var item = new DownloadCriteria(mb); Assert.AreEqual((new MobileList<string>(mb)).ToString(), item.DownloadList.ToString()); }