Ejemplo n.º 1
0
        public async Task TestEmpty()
        {
            var builder = new ConfigurationBuilder()
                          .AddUserSecrets <ShipmentRepoTest>();

            var Configuration = builder.Build();
            var repo          = new ShipmentRepo(Configuration["AzureTableConnectionString"]);

            var entity = await repo.RetrieveEntity <Shipment>("PartitionKey eq 'empty'");

            Assert.AreEqual(null, entity.FirstOrDefault());
        }
Ejemplo n.º 2
0
        public async Task TestInsertOrMerge()
        {
            var builder = new ConfigurationBuilder()
                          .AddUserSecrets <ShipmentRepoTest>();

            var Configuration = builder.Build();
            var repo          = new ShipmentRepo(Configuration["AzureTableConnectionString"]);

            await repo.InsertEntity(new Shipment("testuser", "5505"), true);

            var entity = await repo.RetrieveEntity <Shipment>("PartitionKey eq 'testuser'");

            Assert.AreEqual("5505", entity.FirstOrDefault().ShipmentId);
        }