24 lines
832 B
C#
24 lines
832 B
C#
using FluentAssertions;
|
|
using Oms.Application.Integrations.SmallBagTrack;
|
|
|
|
namespace Oms.Tests;
|
|
|
|
public class SmallBagTrackSignHelperTests
|
|
{
|
|
private const string AppKey = "W2606001";
|
|
private const string AppSecret = "ziK8UzlQ39m3kdL346XEBg8nljY8os52";
|
|
|
|
[Theory]
|
|
[InlineData(1700000000, "A744D764DEE7C925AD6750257A4DEEE7")]
|
|
[InlineData(1782705351, "6C76CF34DFB53A0686C7C97284133BB7")]
|
|
[InlineData(1782705489, "E9633AB5419AB15D95D38903E8001E2D")]
|
|
public void GenerateSign_ShouldMatchOfficialMd5UppercaseRule(long timestamp, string expected)
|
|
{
|
|
var signString = $"appKey={AppKey}×tamp={timestamp}&appSecret={AppSecret}";
|
|
|
|
SmallBagTrackSignHelper.GenerateSign(AppKey, timestamp, AppSecret)
|
|
.Should()
|
|
.Be(expected, because: $"signString={signString}");
|
|
}
|
|
}
|