Exemplo n.º 1
0
        public async Task OneTimeSetUp()
        {
            TestSetUp.Reset(false);

            _robotTest = new RobotTest();
            await _robotTest.OneTimeSetUp();
        }
Exemplo n.º 2
0
        public void OneTimeSetUp()
        {
            TestSetUp.Reset();

            AgentTester.Create <PersonAgent, Person>()
            .ExpectStatusCode(HttpStatusCode.NotFound)
            .Run((a) => a.Agent.GetAsync(404.ToGuid()));
        }
Exemplo n.º 3
0
        public async Task OneTimeSetUp()
        {
            TestSetUp.Reset(false);

            _config = AgentTester.Configuration.GetSection("CosmosDb");
            var cc = new Cosmos.CosmosClient(_config.GetValue <string>("EndPoint"), _config.GetValue <string>("AuthKey"));

            _csu = await CosmosDbContainerSetUp.ReplaceAndOpenAsync(cc, _config.GetValue <string>("Database"),
                                                                    new Cosmos.ContainerProperties
            {
                Id = "Items",
                PartitionKeyPath = "/_partitionKey",
                UniqueKeyPolicy  = new Cosmos.UniqueKeyPolicy {
                    UniqueKeys = { new Cosmos.UniqueKey {
                                       Paths =          { "/serialNo"}
                                   } }
                }
            }, 400);

            await _csu.ImportBatchAsync <RobotTest, Robot>("Data.yaml", "items");
        }
Exemplo n.º 4
0
        public async Task OneTimeSetUp()
        {
            TestSetUp.Reset(false);

            var config = AgentTester.Configuration.GetSection("CosmosDb");

            _removeAfterUse = config.GetValue <bool>("RemoveAfterUse");
            _cosmosDb       = new CosmosDb(new Cosmos.CosmosClient(config.GetValue <string>("EndPoint"), config.GetValue <string>("AuthKey")),
                                           config.GetValue <string>("Database"), createDatabaseIfNotExists: true);

            var rc = await _cosmosDb.ReplaceOrCreateContainerAsync(
                new Cosmos.ContainerProperties
            {
                Id = "Items",
                PartitionKeyPath = "/_partitionKey",
                UniqueKeyPolicy  = new Cosmos.UniqueKeyPolicy {
                    UniqueKeys = { new Cosmos.UniqueKey {
                                       Paths =          { "/serialNo"}
                                   } }
                }
            }, 400);

            await rc.ImportBatchAsync <RobotTest, Robot>("Data.yaml", "Robot");

            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);

            await rdc.ImportValueRefDataBatchAsync <RobotTest>(ReferenceData.Current, "RefData.yaml");
        }
Exemplo n.º 5
0
 public void OneTimeSetUp() => TestSetUp.Reset();
Exemplo n.º 6
0
 public void OneTimeSetUp()
 {
     TestSetUp.Reset(false);
 }