|
|
@@ -1,4 +1,6 @@ |
|
|
|
using BPA.Component.WebApiExtensions; |
|
|
|
using BPA.SaaS.Basic.Api.DTO.InnerEnum; |
|
|
|
using BPA.SaaS.Basic.Api.SDK; |
|
|
|
using BPA.SaaS.Stock.Api.DTO; |
|
|
|
using BPA.SaaS.Stock.Api.IService.Product; |
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|
|
@@ -10,20 +12,38 @@ public class ProductCodeServiceTests : BaseUnitTest |
|
|
|
{ |
|
|
|
private readonly IProductCodeService _productCode; |
|
|
|
private readonly AuthBasicToken _authBasicToken; |
|
|
|
private readonly BasicWebApiSDK _basicWebApiSDK; |
|
|
|
|
|
|
|
public ProductCodeServiceTests() |
|
|
|
{ |
|
|
|
_productCode = GetService<IProductCodeService>(); |
|
|
|
_authBasicToken = GetService<AuthBasicToken>(); |
|
|
|
_basicWebApiSDK = GetService<BasicWebApiSDK>(); |
|
|
|
} |
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
public void TestRemoteAuthToken() |
|
|
|
public void TestRemoteGetAuthToken() |
|
|
|
{ |
|
|
|
var claimInfo = _authBasicToken.GetClaimInfo("admin", "admin").Result; // 远程获取登录凭证 |
|
|
|
Assert.IsTrue(claimInfo != null); |
|
|
|
} |
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
public void TestRemoteGetUserInfo() |
|
|
|
{ |
|
|
|
var token = _authBasicToken.GetToken("admin", "admin").Result; |
|
|
|
var result = _basicWebApiSDK.AuthServiceApi.GetLoginUserAsync(EnumLoginType.FranchiseeUsers, token).Result; |
|
|
|
Assert.IsTrue(result.IsOK); |
|
|
|
} |
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
public void TestRemoteLoginOut() |
|
|
|
{ |
|
|
|
var token = _authBasicToken.GetToken("admin", "admin").Result; |
|
|
|
var result = _basicWebApiSDK.AuthServiceApi.LogoutAsync(token).Result; |
|
|
|
Assert.IsTrue(result.IsOK); |
|
|
|
} |
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
public void TestGetProductList() |
|
|
|
{ |
|
|
|