Posts by Carvin • 31 points
2 posts
-
0
votes1
answer55
viewsA: How to cover using Mock and C#?
Solved. Below is the test I used: public void TestarGetQtdCarteira() { var mockSet = new Mock<DbSet<Contrato>>(); mockSet.As<IList<Contrato>>().Setup(m =>…
-
3
votes1
answer55
viewsQ: How to cover using Mock and C#?
I need to cover for the method example below: public int GetQtdCart() { int qtCart = 0; using (var db = new SfrEntities()) { qtCarteira = db.Set<Contract>().Select(x =>…