public void BoxOfSettingsEntityTest() { IContainer container = Container; var repo = container.Resolve <SettingsRepository>(); var s = repo.Get(1); if (s == null) { s = new SettingsEntity() { Name = "testsetting" }; s.AddEntry("asd", "ddd"); repo.Save(s); } var transformer = container.Resolve <NHibernateBoxTransformation <SettingsBoxMap, SettingsEntity> >(); transformer.Entries = new[] { s }; var boxed = transformer.ToBox(); var xmlBoxer = new XmlBoxPresentation <SettingsBoxMap>(); var ss = xmlBoxer.AsString(boxed); var box = xmlBoxer.FromString(ss); Assert.IsTrue(box.First().Name == s.Name); Assert.AreEqual(s.Entries.First().Name, box.First().Entries.First().Name); }
public string[] Xml(string input) { IList <HttpProxyEntity> list = GetList(input); if (list == null) { return(lists); } var boxed = new Box <HttpProxyBoxMap>(list); var presenter = new XmlBoxPresentation(); Writer.WriteLine(presenter.AsString(boxed)); return(null); }
public FileBoxTransformation(ILog log) { this.log = log; Presentation = new XmlBoxPresentation <T>(); BackupFile = "Restore" + Path.DirectorySeparatorChar + (typeof(T).Name) + ".xml"; }