Add a test catching expirationTime bug (#1336)

This commit is contained in:
nicolas.dorier 2020-03-10 17:11:15 +09:00
parent c598a1827f
commit e6acc19bcc
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
3 changed files with 5 additions and 3 deletions

View File

@ -2493,12 +2493,15 @@ noninventoryitem:
var user = tester.NewAccount(); var user = tester.NewAccount();
user.GrantAccess(); user.GrantAccess();
user.RegisterDerivationScheme("BTC"); user.RegisterDerivationScheme("BTC");
DateTimeOffset expiration = DateTimeOffset.UtcNow + TimeSpan.FromMinutes(21);
var invoice1 = user.BitPay.CreateInvoice(new Invoice() var invoice1 = user.BitPay.CreateInvoice(new Invoice()
{ {
Price = 0.000000012m, Price = 0.000000012m,
Currency = "USD", Currency = "USD",
FullNotifications = true FullNotifications = true,
ExpirationTime = expiration
}, Facade.Merchant); }, Facade.Merchant);
Assert.Equal(expiration.ToUnixTimeSeconds(), invoice1.ExpirationTime.ToUnixTimeSeconds());
var invoice2 = user.BitPay.CreateInvoice(new Invoice() var invoice2 = user.BitPay.CreateInvoice(new Invoice()
{ {
Price = 0.000000019m, Price = 0.000000019m,

View File

@ -41,7 +41,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="NBitpayClient" Version="1.0.0.35" /> <PackageReference Include="NBitpayClient" Version="1.0.0.38" />
<PackageReference Include="DBriize" Version="1.0.1.3" /> <PackageReference Include="DBriize" Version="1.0.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" /> <PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />

View File

@ -3,7 +3,6 @@
<packageSources> <packageSources>
<clear /> <clear />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Openiddict" value="https://www.myget.org/F/openiddict/api/v3/index.json" />
</packageSources> </packageSources>
</configuration> </configuration>