Skip to content

Commit

Permalink
unit test new setup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lisandro-iraguen committed Feb 13, 2024
1 parent edfb8e4 commit e5d73d0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
28 changes: 28 additions & 0 deletions Test/PolicyManagerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Api.Services.Policy;
using Api.Services.Transaction;
using Api.Services.Wallet;
using CardanoSharp.Koios.Client;
using CardanoSharp.Koios.Client.Contracts;
using Microsoft.Extensions.Configuration;
using Moq;
using Refit;
using System.Net;

namespace Test
{
public class PolicyManagerTests
{
private IPolicyManager policyManager;


[SetUp]
public void Setup()
{

var configuration = new Mock<IConfiguration>();
policyManager = new PolicyManager(configuration.Object);
}


}
}
10 changes: 1 addition & 9 deletions Test/TransactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,8 @@ public void Setup()
var epochClient = new Mock<IEpochClient>();


var epoc = new ProtocolParameters();
epoc.EpochNo = 8;
var expectedParameters = new ProtocolParameters[] { epoc };
var apiResponse = new ApiResponse<ProtocolParameters[]>(new HttpResponseMessage(System.Net.HttpStatusCode.OK), expectedParameters, null);
epochClient.Setup(x => x.GetProtocolParameters(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<string>()))
.ReturnsAsync(apiResponse);

transactionService = new TransactionService(configuration.Object, policyManager.Object, addressClient.Object, networkClient.Object, epochClient.Object);

}


}
}

0 comments on commit e5d73d0

Please sign in to comment.