public void LoadAbsentOverrideTest() { string upfilePath = Helper.PathCombine("TestData", "UpfileTest", "Upfile.xml"); string upfileOverridePath = Helper.PathCombine("TestData", "UpfileTest", "NoUpfileInIt", "UpfileOverride.xml"); Upfile upfile = Upfile.LoadXml(upfilePath); upfile.LoadOverrides(upfileOverridePath); Assert.IsTrue(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, Helper.PathCombine("Path", "To", "Some", "Repository"))), "Original repository not found"); Assert.IsFalse(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, Helper.PathCombine("Path", "To", "Another", "Repository"))), "Loaded absent file"); }
public void LoadPresentOverrideTest() { string upfilePath = Helper.PathCombine("TestData", "UpfileTest", "Upfile.xml"); string upfileOverridePath = Helper.PathCombine("TestData", "UpfileTest", "UpliftSettings.xml"); Upfile upfile = Upfile.LoadXml(upfilePath); upfile.overridePath = upfileOverridePath; upfile.LoadOverrides(); Assert.IsTrue(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, Helper.PathCombine("Path", "To", "Some", "Repository"))), "Original repository not found"); Assert.IsTrue(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, Helper.PathCombine("Path", "To", "Another", "Repository"))), "Override repository not found"); }
public void LoadPresentOverrideTest() { string upfilePath = string.Join(Path.DirectorySeparatorChar.ToString(), new string[] { "TestData", "UpfileTest", "Upfile.xml" }); string upfileOverridePath = string.Join(Path.DirectorySeparatorChar.ToString(), new string[] { "TestData", "UpfileTest", "UpfileOverride.xml" }); Upfile upfile = Upfile.LoadXml(upfilePath); upfile.LoadOverrides(upfileOverridePath); Assert.IsTrue(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, "Path\\To\\Some\\Repository")), "Original repository not found"); Assert.IsTrue(upfile.Repositories.Any(repo => repo is FileRepository && string.Equals((repo as FileRepository).Path, "Path\\To\\Another\\Repository")), "Override repository not found"); }