Code re-factorings and formatting for Basket.API Test projects

This commit is contained in:
Rafsanul Hasan 2018-09-09 05:46:22 +06:00
parent d44c12e718
commit d6ad2b4a09
No known key found for this signature in database
GPG Key ID: FC57FD2D87BE60DD
9 changed files with 403 additions and 406 deletions

View File

@ -4,9 +4,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Moq;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xunit;
@ -14,7 +12,7 @@ namespace Basket.FunctionalTests
{
public class RedisBasketRepositoryTests
{
private Mock<IOptionsSnapshot<BasketSettings>> _optionsMock;
private readonly Mock<IOptionsSnapshot<BasketSettings>> _optionsMock;
public RedisBasketRepositoryTests()
{

View File

@ -4,7 +4,6 @@ using Microsoft.eShopOnContainers.WebMVC.Controllers;
using Microsoft.eShopOnContainers.WebMVC.Services;
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
using Moq;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
@ -91,7 +90,7 @@ namespace UnitTest.Basket.Application
//Arrange
var fakeCatalogItem = GetFakeCatalogItem();
_basketServiceMock.Setup(x => x.AddItemToBasket(It.IsAny<ApplicationUser>(), It.IsAny<Int32>()))
_basketServiceMock.Setup(x => x.AddItemToBasket(It.IsAny<ApplicationUser>(), It.IsAny<int>()))
.Returns(Task.FromResult(1));
//Act