Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Added some test to FeeBumpTransactionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirbyrawr committed Apr 29, 2020
1 parent d38fad6 commit 42a6f4c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions stellar-dotnet-sdk-test/FeeBumpTransactionTest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Security.Cryptography;
using dotnetstandard_bip32;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -44,6 +45,35 @@ public void Initialize()
Transaction = TransactionBuilder.BuildFeeBumpTransaction(FeeSource, InnerTransaction, 100);
}

[TestMethod]
public void TestLessThanInnerBaseFeeRate()
{
try
{
var transaction = TransactionBuilder.BuildFeeBumpTransaction(FeeSource, InnerTransaction, 50);
}
catch (Exception e)
{
var innerOps = InnerTransaction.Operations.Length;
var innerBaseFeeRate = InnerTransaction.Fee / innerOps;

Assert.AreEqual(e.Message, $"Invalid fee, it should be at least {innerBaseFeeRate} stroops");
}
}

[TestMethod]
public void TestLessThanBaseFee()
{
try
{
var transaction = TransactionBuilder.BuildFeeBumpTransaction(FeeSource, InnerTransaction, 50);
}
catch (Exception e)
{
Assert.AreEqual(e.Message, $"Invalid fee, it should be at least {BaseFee} stroops");
}
}

[TestMethod]
public void TestBuildFromTransactionEnvelope()
{
Expand Down

0 comments on commit 42a6f4c

Please sign in to comment.