Beispiel #1
0
        public async Task Run()
        {
            /*
             * LAST NAME
             */

            // Creating a new LastName
            LastNameResponse created = await Create(staticVault);

            // Retrieving a existent LastName
            LastNameResponse retrieved = await Retrieve(staticVault, created.Id);

            // Deleting a existent LastName
            await Delete(staticVault, retrieved.Id);


            /*
             * LAST NAME WITH GENDER
             */

            // Creating a new LastName
            LastNameResponse createdWithGender = await CreateWithGender(staticVault);

            // Retrieving a existent LastName
            LastNameResponse retrievedWithGender = await Retrieve(staticVault, createdWithGender.Id);

            // Deleting a existent LastName
            await Delete(staticVault, retrievedWithGender.Id);
        }
        public async Task Run()
        {
            var sdk    = new Nullafi.NullafiSDK(Environment.GetEnvironmentVariable("API_KEY"));
            var client = await sdk.CreateClient();

            var staticVault = await client.CreateStaticVault("Last Name Vault Example", null);

            LastNameResponse created = await Create(staticVault);

            LastNameResponse retrieved = await Retrieve(staticVault, created.Id);

            await RetrieveFromRealData(staticVault, retrieved.LastName);
            await Delete(staticVault, retrieved.Id);

            Assert.AreEqual(created.Id, retrieved.Id);
            Assert.AreEqual(created.LastName, retrieved.LastName);
            Assert.AreEqual(created.LastNameAlias, retrieved.LastNameAlias);

            LastNameResponse createdWithGender = await CreateWithGender(staticVault);

            LastNameResponse retrievedWithGender = await Retrieve(staticVault, createdWithGender.Id);

            await RetrieveFromRealData(staticVault, retrievedWithGender.LastName);
            await Delete(staticVault, retrievedWithGender.Id);

            Assert.AreEqual(createdWithGender.Id, retrievedWithGender.Id);
            Assert.AreEqual(createdWithGender.LastName, retrievedWithGender.LastName);
            Assert.AreEqual(createdWithGender.LastNameAlias, retrievedWithGender.LastNameAlias);

            await client.DeleteStaticVault(staticVault.VaultId);
        }
Beispiel #3
0
        private async Task <LastNameResponse> Retrieve(StaticVault vault, String id)
        {
            LastNameResponse retrieved = await vault.LastName.Retrieve(id);

            Console.WriteLine("//// LastNameExample.retrieve:");
            Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(retrieved));

            return(retrieved);
        }
Beispiel #4
0
        private async Task <LastNameResponse> Create(StaticVault vault)
        {
            String name = "example";

            LastNameResponse created = await vault.LastName.Create(name);

            Console.WriteLine("//// LastNameExample.create:");
            Console.WriteLine("/// Name: " + name);
            Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(created));

            return(created);
        }