| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Quadarax.Application.QLiberace.Base.Repositories;
- using Quadarax.Application.QLiberace.Common.Configuration;
- using Quadarax.Foundation.Core.Data;
- using Quadarax.Foundation.Core.Data.Domain;
- using Quadarax.Foundation.Core.Data.Interface.Domain;
- namespace Quadarax.Application.QLiberace.Base.Tests.Services
- {
- [TestFixture(Category = "Srv")]
- public class SettingsServiceTest
- {
- private const string CfgFileName = "qlbrc.test.json";
- private IUnitOfWork<BaseInMemoryDbContext> _uow;
- [SetUp]
- public void Setup()
- {
- OlbrcConfiguration.ConfigurationFileName = CfgFileName;
- var context = new BaseInMemoryDbContext();
- context.Database.EnsureCreated();
- var doc = (IDomainContextResolver<BaseInMemoryDbContext>)new DomainContextResolver<BaseInMemoryDbContext>(context);
- _uow = new UnitOfWork<BaseInMemoryDbContext>(doc);
- }
- [Test]
- public void TestMe()
- {
- var repo = new RepoSetting(_uow.As<IDataDomain>());
- var newItem = repo.New();
- newItem.Code = "foo";
- newItem.ValueTypeQualified = "System.String";
- newItem.Description = "Test";
- newItem.ModuleCode = "Base";
- newItem.Value = "bar";
- repo.Set(newItem);
- _uow.Commit();
- var fii = repo.Query(Paging.NoPaging(),false).ToArray();
- }
- }
- }
|