Skip to content

Instantly share code, notes, and snippets.

@JPVenson
Created September 8, 2018 10:11
Show Gist options
  • Save JPVenson/6a705ed3d8f9c3f180f9b61b6538cade to your computer and use it in GitHub Desktop.
Save JPVenson/6a705ed3d8f9c3f180f9b61b6538cade to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JPB.DataAccess.Manager;
using JPB.DataAccess.Tests.TestFramework;
using NUnit.Framework;
using NUnit.Framework.Internal;
namespace JPB.DataAccess.Tests.TempTests
{
public class sg_atributos
{
public string NOMBRETABLA { get; set; }
public int ORDEN { get; set; }
public string CAMPO { get; set; }
public string ETIQUETA { get; set; }
public string TIPODATO { get; set; }
public string TAMANO { get; set; }
public string DOMINIO { get; set; }
public int REQUERIDO { get; set; }
public string VALORDEFAULT { get; set; }
public int EDITABLE { get; set; }
public int VISIBLE { get; set; }
}
[TestFixture()]
[Explicit]
public class ChargaTests
{
public ChargaTests()
{
}
public string DbFile { get; set; }
[SetUp]
public void InitConnectionString()
{
DbFile = Path.GetTempFileName();
}
[TearDown]
public void CloseConnections()
{
File.Delete(DbFile);
}
[Test]
public void TestSelect()
{
var mgr = new DbAccessLayer(DbAccessType.SqLite, "Data Source=" + DbFile + ";");
var sb = new StringBuilder();
sb.AppendLine(string.Format("CREATE TABLE sg_atributos ("));
sb.AppendLine(string.Format("NOMBRETABLA TEXT,"));
sb.AppendLine(string.Format("CAMPO TEXT,"));
sb.AppendLine(string.Format("ETIQUETA TEXT,"));
sb.AppendLine(string.Format("TIPODATO TEXT,"));
sb.AppendLine(string.Format("TAMANO TEXT,"));
sb.AppendLine(string.Format("DOMINIO TEXT,"));
sb.AppendLine(string.Format("VALORDEFAULT TEXT,"));
sb.AppendLine(string.Format("ORDEN INTEGER,"));
sb.AppendLine(string.Format("REQUERIDO INTEGER,"));
sb.AppendLine(string.Format("EDITABLE INTEGER,"));
sb.AppendLine(string.Format("VISIBLE INTEGER"));
sb.AppendLine(")");
mgr.ExecuteGenericCommand(sb.ToString());
mgr.LoadCompleteResultBeforeMapping = false;
var sg = mgr.Select<sg_atributos>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment