Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions ValuesControllerTests/ValuesControllerTests.cs
Original file line number Diff line number Diff line change
@@ -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<IDynamoDbManager<MyModel>> _dbManager;
Expand Down Expand Up @@ -43,12 +40,12 @@ public async Task GetAllData_Test()
.ReturnsAsync(searchResult);

var result = _valueController.GetAllData("new", "admin");
Assert.IsType<OkObjectResult>(result.Result);
Assert.IsType<OkObjectResult>(result.Result);
}

[Fact]
public async Task SaveData_Test()
{
{
var searchResult = new List<MyModel>()
{
new MyModel(){ }
Expand All @@ -65,7 +62,7 @@ public async Task SaveData_Test()
};

var result = _valueController.SaveData(dataToSave, "new");
Assert.IsType<OkObjectResult>(result.Result);
Assert.IsType<OkResult>(result.Result);
}

[Fact]
Expand All @@ -79,9 +76,9 @@ public async Task DeleteData_Test()
_dbManager
.Setup(_ => _.GetAsync(It.IsAny<List<ScanCondition>>()))
.ReturnsAsync(searchResult);
var result = _valueController.DeleteData("id123");
Assert.IsType<OkObjectResult>(result.Result);

var result = await _valueController.DeleteData("id123");
Assert.IsType<OkResult>(result);
}
}
}