From faacd3501c460fa81db8a228da7494e2f566b598 Mon Sep 17 00:00:00 2001 From: Filipe Ferreira de Souza Date: Fri, 26 Oct 2018 10:59:22 -0300 Subject: [PATCH] Fixing tests --- .../ValuesControllerTests.cs | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/ValuesControllerTests/ValuesControllerTests.cs b/ValuesControllerTests/ValuesControllerTests.cs index e785459..71d2451 100644 --- a/ValuesControllerTests/ValuesControllerTests.cs +++ b/ValuesControllerTests/ValuesControllerTests.cs @@ -1,19 +1,16 @@ -using System; -using Xunit; -using Moq; -using Microsoft.Extensions.Options; -using System.Collections; -using System.Collections.Generic; using Amazon.DynamoDBv2.DataModel; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Dynamo.Controllers; using Dynamo.Helper; using Dynamo.Model; -using Dynamo.Controllers; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Moq; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; namespace ValuesControllerTests -{ +{ public class ValuesControllerTests { private Mock> _dbManager; @@ -43,12 +40,12 @@ public async Task GetAllData_Test() .ReturnsAsync(searchResult); var result = _valueController.GetAllData("new", "admin"); - Assert.IsType(result.Result); + Assert.IsType(result.Result); } [Fact] public async Task SaveData_Test() - { + { var searchResult = new List() { new MyModel(){ } @@ -65,7 +62,7 @@ public async Task SaveData_Test() }; var result = _valueController.SaveData(dataToSave, "new"); - Assert.IsType(result.Result); + Assert.IsType(result.Result); } [Fact] @@ -79,9 +76,9 @@ public async Task DeleteData_Test() _dbManager .Setup(_ => _.GetAsync(It.IsAny>())) .ReturnsAsync(searchResult); - - var result = _valueController.DeleteData("id123"); - Assert.IsType(result.Result); + + var result = await _valueController.DeleteData("id123"); + Assert.IsType(result); } } }