Пример #1
0
        private void BalanceStable()
        {
            var apiInstance = new DefaultApi(nodeAddress);
            var testCase    = new[]
            {
                new
                {
                    name  = "unknown address",
                    addrs = new[] { "prRXwTcDK24hs6AFxj69UuWae3LzhrsPW9" },
                    file  = "balance-noaddrs.golden"
                },
                new
                {
                    name  = "one address",
                    addrs = new[] { "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf" },
                    file  = "balance-2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf.golden"
                },
                new
                {
                    name  = "duplicate address",
                    addrs = new[] { "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf", "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf" },
                    file  = "balance-2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf.golden"
                },
                new
                {
                    name  = "two address",
                    addrs = new[] { "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf", "212mwY3Dmey6vwnWpiph99zzCmopXTqeVEN" },
                    file  = "balance-two-addrs.golden"
                }
            };

            foreach (var tc in testCase)
            {
                var resultg = apiInstance.BalanceGet(string.Join(",", tc.addrs));
                CheckGoldenFile(tc.file, resultg);
                if (useCsrf)
                {
                    apiInstance.Configuration.AddApiKeyPrefix("X-CSRF-TOKEN", GetCsrf());
                }

                var resultp = apiInstance.BalancePost(string.Join(",", tc.addrs));
                Assert.Equal(resultg, resultp);
            }
        }