Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }