Beispiel #1
0
        public void OneTimeSetUp()
        {
            TestSetUp.DefaultEnvironmentVariablePrefix = "Hr";
            TestSetUp.AddWebApiAgentArgsType <IHrWebApiAgentArgs, HrWebApiAgentArgs>();
            TestSetUp.DefaultExpectNoEvents = true;
            var config = AgentTester.BuildConfiguration <Startup>();

            TestSetUp.RegisterSetUp(async(count, _) =>
            {
                return(await DatabaseExecutor.RunAsync(new DatabaseExecutorArgs(
                                                           count == 0 ? DatabaseExecutorCommand.ResetAndDatabase : DatabaseExecutorCommand.ResetAndData, config["ConnectionStrings:Database"],
                                                           typeof(Database.Program).Assembly, Assembly.GetExecutingAssembly())
                {
                    UseBeefDbo = true
                }).ConfigureAwait(false) == 0);
            });
        }
Beispiel #2
0
        public void OneTimeSetUp()
        {
            var config = AgentTester.BuildConfiguration <Startup>("Beef");

            TestSetUp.SetDefaultLocalReferenceData <IReferenceData, ReferenceDataAgentProvider, IReferenceDataAgent, ReferenceDataAgent>();
            TestSetUp.AddWebApiAgentArgsType <IDemoWebApiAgentArgs, DemoWebApiAgentArgs>();
            TestSetUp.RegisterSetUp(async(count, data) =>
            {
                var args = new DatabaseExecutorArgs(
                    count == 0 ? DatabaseExecutorCommand.ResetAndDatabase : DatabaseExecutorCommand.ResetAndData, config["ConnectionStrings:BeefDemo"],
                    typeof(Database.Program).Assembly, Assembly.GetExecutingAssembly(), typeof(Beef.Demo.Abc.Database.Scripts).Assembly)
                {
                    UseBeefDbo = true
                }.AddSchemaOrder("Sec", "Ref", "Test", "Demo");

                return(await DatabaseExecutor.RunAsync(args).ConfigureAwait(false) == 0);
            });
        }
Beispiel #3
0
        public void OneTimeSetUp()
        {
            TestSetUp.DefaultEnvironmentVariablePrefix = "AppName";
            TestSetUp.AddWebApiAgentArgsType <IAppNameWebApiAgentArgs, AppNameWebApiAgentArgs>();
            TestSetUp.DefaultExpectNoEvents = false;

            var config = AgentTester.BuildConfiguration <Startup>("AppName");

            TestSetUp.RegisterSetUp(async(count, _) =>
            {
                var cc          = config.GetSection("CosmosDb");
                _removeAfterUse = config.GetValue <bool>("RemoveAfterUse");
                _cosmosDb       = new AppNameCosmosDb(new Cosmos.CosmosClient(cc.GetValue <string>("EndPoint"), cc.GetValue <string>("AuthKey")), cc.GetValue <string>("Database"), createDatabaseIfNotExists: true);

                var rc = await _cosmosDb.ReplaceOrCreateContainerAsync(
                    new Cosmos.ContainerProperties
                {
                    Id = "Person",
                    PartitionKeyPath = "/_partitionKey"
                }, 400).ConfigureAwait(false);

                await rc.ImportBatchAsync <PersonTest, Person>("Person.yaml", "Person").ConfigureAwait(false);

                var rdc = await _cosmosDb.ReplaceOrCreateContainerAsync(
                    new Cosmos.ContainerProperties
                {
                    Id = "RefData",
                    PartitionKeyPath = "/_partitionKey",
                    UniqueKeyPolicy  = new Cosmos.UniqueKeyPolicy {
                        UniqueKeys = { new Cosmos.UniqueKey {
                                           Paths =          { "/type","/value/code" }
                                       } }
                    }
                }, 400).ConfigureAwait(false);

                await rdc.ImportValueRefDataBatchAsync <PersonTest, ReferenceData>("RefData.yaml").ConfigureAwait(false);

                return(true);
            });
        }
Beispiel #4
0
 public void OneTimeSetUp()
 {
     TestSetUp.DefaultEnvironmentVariablePrefix = "AppName";
     TestSetUp.AddWebApiAgentArgsType <IAppNameWebApiAgentArgs, AppNameWebApiAgentArgs>();
     TestSetUp.DefaultExpectNoEvents = false;
 }