//[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); } }
//[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); } }
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); } }