public void TestProjectInit()
 {
     using (var scope = ServiceProvider.CreateScope())
     {
         var sp  = scope.ServiceProvider;
         var res = sp.GetService <IProjectService>().AddProjectInfoAsync(DataFaker.GetProjectInfo(), true).Result;
         Assert.True(res.Id > 0);
     }
 }
 public void TestConfigEntitySourcePick()
 {
     using (var scope = ServiceProvider.CreateScope())
     {
         var sp      = scope.ServiceProvider;
         var service = sp.GetService <IGeneratorConfigService>();
         var dsids   = service.GetEntitySource(new PageRequest()).Result.Datas.Select(x => x.Id);
         var config  = DataFaker.GetCodeFirstConfig()
                       .SetEntitySourceRandom(dsids);
         var r = service.AddGConfig(config, true).Result;
         Assert.True(r.Id > 0);
     }
 }
 public void TestBuilderOptionsInit()
 {
     using (var scope = ServiceProvider.CreateScope())
     {
         var sp     = scope.ServiceProvider;
         var random = sp.GetService <ITemplateService>()
                      .GetTemplatePageAsync(new PageRequest())
                      .Result
                      .Datas
                      .Select(x => x.Id);
         var res = sp.GetService <IBuilderService>().AddBuilder(DataFaker.GetBuilderOption(random), true).Result;
         Assert.True(res.Id > 0);
     }
 }
        public void TestDataSourceInit()
        {
            using (var scope = ServiceProvider.CreateScope())
            {
                var sp         = scope.ServiceProvider;
                var dataSource = sp.GetService <IGeneratorConfigService>().AddDataSource(DataFaker.GetDataSource(), true).Result;

                Assert.True(dataSource.Id > 0);
            }
        }
 public void TestEntitySourceInit()
 {
     using (var scope = ServiceProvider.CreateScope())
     {
         var sp           = scope.ServiceProvider;
         var entitySource = sp.GetService <IGeneratorConfigService>().AddEntitySource(DataFaker.GetEntitySource(), true);
         Assert.True(entitySource.Id > 0);
     }
 }