Beispiel #1
0
        //[ExpectedException(typeof(SparkApiException), "Permission Denied")]
        public void GivenInvalidDeviceIdExpectErrorPermissionDenied()
        {
            var badClient = new SparkClient(client.AccessToken, "badid");

            try {
                SparkFunctionResult result = badClient.ExecuteFunction("doesn't matter");
            }
            catch (SparkApiException spex)
            {
                Assert.AreEqual("Permission Denied", spex.Message);
            }
        }
 public void GivenInvalidAccessTokenExpectErrorInvalidGrant()
 {
     var badClient = new SparkClient("badtoken", "");
     try
     {
         SparkFunctionResult result = badClient.ExecuteFunction("doesn't matter");
     }
     catch (SparkApiException spex)
     {
         Assert.AreEqual("invalid_grant", spex.Message);
     }
 }
Beispiel #3
0
        //[ExpectedException(typeof(SparkApiException), "invalid_grant")]
        public void GivenInvalidAccessTokenExpectErrorInvalidGrant()
        {
            var badClient = new SparkClient("badtoken", "");

            try
            {
                SparkFunctionResult result = badClient.ExecuteFunction("doesn't matter");
            }
            catch (SparkApiException spex)
            {
                Assert.AreEqual("invalid_grant", spex.Message);
            }
        }
Beispiel #4
0
        public void GivenClientWhenExecuteReturnOneExpect1()
        {
            SparkFunctionResult result = client.ExecuteFunction("returnOne");

            Assert.AreEqual("1", result.Return_value);
        }
 public void GivenInvalidDeviceIdExpectErrorPermissionDenied()
 {
     var badClient = new SparkClient(client.AccessToken, "badid");
     try {
         SparkFunctionResult result = badClient.ExecuteFunction("doesn't matter");
     }
     catch (SparkApiException spex)
     {
         Assert.AreEqual("Permission Denied", spex.Message);
     }
 }