FlutterLoganTest.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // FlutterLoganTest.m
  3. // Runner_test
  4. //
  5. // Created by M小军 on 2019/12/20.
  6. // Copyright © 2019 The Chromium Authors. All rights reserved.
  7. //
  8. #import <XCTest/XCTest.h>
  9. #import <Kiwi/Kiwi.h>
  10. #import "FlutterLoganPlugin.h"
  11. #import <Flutter/Flutter.h>
  12. SPEC_BEGIN(FlutterLogan)
  13. describe(@"Flutter Logan test", ^{
  14. context(@"func test", ^{
  15. FlutterLoganPlugin *plugin = [FlutterLoganPlugin new];
  16. it(@"init", ^{
  17. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"init" arguments:@{
  18. @"aesKey": @"0123456789012345",
  19. @"aesIv": @"0123456789012345",
  20. @"MaxFileLen": @(1024*1024*10)}];
  21. [plugin handleMethodCall:call result:^(id _Nullable result) {
  22. }];
  23. });
  24. it(@"log", ^{
  25. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"log" arguments:@{
  26. @"type": @10,
  27. @"log": @"this is a test log"}];
  28. [plugin handleMethodCall:call result:^(id _Nullable result) {
  29. }];
  30. });
  31. it(@"flush", ^{
  32. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"flush" arguments:@{}];
  33. [plugin handleMethodCall:call result:^(id _Nullable result) {
  34. }];
  35. });
  36. it(@"getUploadPath", ^{
  37. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"getUploadPath" arguments:@{}];
  38. [plugin handleMethodCall:call result:^(id _Nullable result) {
  39. }];
  40. });
  41. it(@"upload", ^{
  42. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"upload" arguments:@{
  43. @"date" : @"2019-12-20",
  44. @"url" : @"test/url",
  45. @"appId" : @"FlutterTestAppId",
  46. @"unionId" : @"FlutterTestAppId",
  47. @"deviceId" : @"FlutterTestAppId";
  48. }];
  49. [plugin handleMethodCall:call result:^(id _Nullable result) {
  50. }];
  51. });
  52. it(@"cleanLogs", ^{
  53. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"cleanAllLogs" arguments:@{}];
  54. [plugin handleMethodCall:call result:^(id _Nullable result) {
  55. }];
  56. });
  57. });
  58. });
  59. SPEC_END