コード例 #1
0
        public async Task Run()
        {
            var SDK    = new NullafiSDK(apiKey);
            var client = await SDK.CreateClient();

            await new CommunicationVaultExample(client).Run();
            await new StaticVaultExample(client).Run();

            Console.Read();
        }
コード例 #2
0
        public async Task GivenRequestToUseTheSDK_WhenCreatingClient_ShouldReturnAuthenticatedClientInstance()
        {
            Mock.Server.Given(Request.Create().WithPath("/authentication/token").UsingPost())
            .RespondWith(
                Response.Create()
                .WithStatusCode(HttpStatusCode.OK)
                .WithBody(JsonConvert.SerializeObject(new
            {
                Token   = "some-token",
                HashKey = "some-hash-key",
            }))
                );

            var sdk    = new NullafiSDK("dlCoYgYqvTQPHhIt9VB3Yo+BI5QhJ3hgZi5t/jkxThE=");
            var client = await sdk.CreateClient();

            Assert.IsNotNull(client);
        }