ClientTest.cs 921 B

12345678910111213141516171819202122232425262728293031
  1. using NUnit.Framework;
  2. using Alipay.EasySDK.Factory;
  3. using Alipay.EasySDK.Security.TextRisk.Models;
  4. using Alipay.EasySDK.Kernel.Util;
  5. namespace UnitTest.Security.TextRisk
  6. {
  7. public class ClientTest
  8. {
  9. [SetUp]
  10. public void SetUp()
  11. {
  12. Factory.SetOptions(TestAccount.Mini.CONFIG);
  13. }
  14. [Test]
  15. public void TestDetect()
  16. {
  17. AlipaySecurityRiskContentDetectResponse response = Factory.Security.TextRisk().Detect("test");
  18. Assert.IsTrue(ResponseChecker.Success(response));
  19. Assert.AreEqual(response.Code, "10000");
  20. Assert.AreEqual(response.Msg, "Success");
  21. Assert.Null(response.SubCode);
  22. Assert.Null(response.SubMsg);
  23. Assert.NotNull(response.HttpBody);
  24. Assert.AreEqual(response.Action, "PASSED");
  25. Assert.NotNull(response.UniqueId);
  26. }
  27. }
  28. }