public void XmlFileRepositoryInvalidMessageTest() { var message = TestHelpers.FakeInvalidMessage(); var token = TestHelpers.FakeToken(); _repository.Initialize(token); _repository.WriteMessage(message); XDocument xdoc = XDocument.Load(_fileName); XElement tokenElement = xdoc.Document.Descendants("token").FirstOrDefault(); Assert.IsNotNull(tokenElement); Assert.IsFalse(tokenElement.Nodes().Any()); }
public static void CreateScriptXml(int index = 0) { var cmdLet = CreateCmdLet(index); var fileName = @"Files\Scripts.xml"; var rep = new XmlFileRepository <CmdLet, Guid>(); rep.Initialize(fileName); rep.Create(cmdLet); }
public static CmdLet LoadScriptXml(string scriptName) { var fileName = @"Files\Scripts.xml"; var rep = new XmlFileRepository <CmdLet, Guid>(); rep.Initialize(fileName); var cmdLet = rep.Filter(x => x.Name == scriptName).FirstOrDefault(); return(cmdLet); }