update: 添加测试用例
							parent
							
								
									78f9e3b330
								
							
						
					
					
						commit
						ef3a11c382
					
				|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 75760985db114e44bfcd901ed50af96c | ||||||
|  | timeCreated: 1712580213 | ||||||
|  | @ -0,0 +1,22 @@ | ||||||
|  | { | ||||||
|  |     "name": "GuruSDK.Tests", | ||||||
|  |     "rootNamespace": "Guru.Tests", | ||||||
|  |     "references": [ | ||||||
|  |         "UnityEngine.TestRunner", | ||||||
|  |         "UnityEditor.TestRunner", | ||||||
|  |         "Guru.Runtime" | ||||||
|  |     ], | ||||||
|  |     "includePlatforms": [], | ||||||
|  |     "excludePlatforms": [], | ||||||
|  |     "allowUnsafeCode": false, | ||||||
|  |     "overrideReferences": true, | ||||||
|  |     "precompiledReferences": [ | ||||||
|  |         "nunit.framework.dll" | ||||||
|  |     ], | ||||||
|  |     "autoReferenced": false, | ||||||
|  |     "defineConstraints": [ | ||||||
|  |         "UNITY_INCLUDE_TESTS" | ||||||
|  |     ], | ||||||
|  |     "versionDefines": [], | ||||||
|  |     "noEngineReferences": false | ||||||
|  | } | ||||||
|  | @ -0,0 +1,7 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 9eaf5abb3054d452ba2776169a31aa91 | ||||||
|  | AssemblyDefinitionImporter: | ||||||
|  |   externalObjects: {} | ||||||
|  |   userData:  | ||||||
|  |   assetBundleName:  | ||||||
|  |   assetBundleVariant:  | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: c3f29532318446f2aa35c275859dad0d | ||||||
|  | timeCreated: 1712580248 | ||||||
|  | @ -0,0 +1,43 @@ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | using UnityEngine; | ||||||
|  | 
 | ||||||
|  | namespace Guru.Tests | ||||||
|  | { | ||||||
|  |     using Guru; | ||||||
|  |     using UnityEditor; | ||||||
|  |     using NUnit.Framework; | ||||||
|  |      | ||||||
|  |     public class Test_IAP | ||||||
|  |     { | ||||||
|  | 
 | ||||||
|  |         [Test] | ||||||
|  |         public void Test__AppleOrders() | ||||||
|  |         { | ||||||
|  |             var model = IAPModel.Load(); | ||||||
|  |             int level = 1; | ||||||
|  |             for (int i = 0; i < 5; i++) | ||||||
|  |             { | ||||||
|  |                 model.AddAppleOrder(new AppleOrderData(0, $"i.iap.test.icon_{i}", "receipt_{i}", level)); | ||||||
|  |                 level++; | ||||||
|  |             } | ||||||
|  |              | ||||||
|  |             if (model.HasUnreportedAppleOrder) | ||||||
|  |             { | ||||||
|  |                 int i = 0; | ||||||
|  |                 while (model.appleOrders.Count > 0  | ||||||
|  |                        && i < model.appleOrders.Count) | ||||||
|  |                 { | ||||||
|  |                     var o = model.appleOrders[i]; | ||||||
|  |                     model.RemoveAppleOrder(o); | ||||||
|  |                     i++; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 7181a5508c604c439d3f4585ff49a5e0 | ||||||
|  | timeCreated: 1712580254 | ||||||
|  | @ -0,0 +1,8 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 80c78f22e10d0411d85fb2a24c69cab2 | ||||||
|  | folderAsset: yes | ||||||
|  | DefaultImporter: | ||||||
|  |   externalObjects: {} | ||||||
|  |   userData:  | ||||||
|  |   assetBundleName:  | ||||||
|  |   assetBundleVariant:  | ||||||
		Loading…
	
		Reference in New Issue