public void Can_add_credentials(string username, bool isAdmin, string expectedUser)
        {
            const string password = "******";
            var          request  = new AnalyticsRequest(Statement);

            var formValues = request.GetFormValues();

            Assert.False(formValues.ContainsKey("creds"));

            request.AddCredentials(username, password, isAdmin);
            formValues = request.GetFormValues();

            var creds = (List <dynamic>)formValues["creds"];

            Assert.Equal(1, creds.Count);

            var expected = $"{{ user = {expectedUser}, pass = {password} }}";

            foreach (var cred in creds)
            {
                Assert.Equal(expected, cred.ToString());
            }

            var json = JsonConvert.DeserializeObject <dynamic>(
                request.GetFormValuesAsJson()
                );

            Assert.Equal(1, json.creds.Count);
            Assert.Equal($"{{\"user\":\"{expectedUser}\",\"pass\":\"password\"}}", json.creds[0].ToString(Formatting.None));
        }