private XmlDocument GetXmlDoc(string fileName) { var file = SugarRushHandler.GetFiles(_dir, "*").Where(f => f.Name == fileName).First(); var doc = new XmlDocument(); doc.Load(file.FullName); return(doc); }
public void ShouldUpdateVersionInRefreshFile() { var fileToUpdate = SugarRushHandler.GetFiles(_dir, "*.refresh").FirstOrDefault(f => f.Name == "RefreshFileExample1.dll.refresh"); var expectedFile = SugarRushHandler.GetFiles(_dir, "*.refresh").FirstOrDefault(f => f.Name == "RefreshFileUpdatePackageVersion.dll.refresh"); var assList = GetAssemblyNames(_dir + @"\Resources\DLLs\Couchbase.dll", _dir + @"\Resources\DLLs\Enyim.Caching.dll"); var assDic = assList.ToDictionary(k => k.Name, v => v.Version.ToString()); fileToUpdate.UpdateRefreshFile("CouchbaseNetClient.1.3.10", assDic); Assert.AreEqual(System.IO.File.ReadAllText(fileToUpdate.FullName), System.IO.File.ReadAllText(expectedFile.FullName)); }
public void ShouldValidateFalseConfiguration() { var config = new SugarRushConfiguration { folderPath = @"C:\Some\Random\Bull", nugetRepoUrl = "SomeBullRepo.com", packageID = "SomePackage" }; Assert.IsFalse(SugarRushHandler.IsValidConfig(config)); }
public void ShouldGetAllNotExcludedFilesInDir() { var exclusionPaths = new HashSet <string> { _dir + @"\Resources\Files\FilesSub" }; var files = SugarRushHandler.GetFiles(_dir + @"\Resources\Files\", "*.txt"); var excludedFiles = SugarRushHandler.FilterFiles(files, exclusionPaths); Assert.IsTrue(excludedFiles.Count() == 3); }
public void ShouldGetAllFilesInDir() { var files = SugarRushHandler.GetFiles(_dir + @"\Resources\Files\", "*.txt"); Assert.IsTrue(files.Length == 5); }