diff --git a/test/MusicStore.Spa.Test/ShoppingCartTest.cs b/test/MusicStore.Spa.Test/ShoppingCartTest.cs index 22b5fac40b..21a17b6060 100644 --- a/test/MusicStore.Spa.Test/ShoppingCartTest.cs +++ b/test/MusicStore.Spa.Test/ShoppingCartTest.cs @@ -4,6 +4,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Features.Internal; using Microsoft.AspNet.Http.Internal; +using Microsoft.Framework.Primitives; using Xunit; namespace MusicStore.Models @@ -35,7 +36,7 @@ namespace MusicStore.Models public CookiesFeature(string key, string value) { - _cookies = new ReadableStringCollection(new Dictionary() + _cookies = new ReadableStringCollection(new Dictionary() { { key, new[] { value } } }); diff --git a/test/MusicStore.Test/CheckoutControllerTest.cs b/test/MusicStore.Test/CheckoutControllerTest.cs index 4156400ba9..4dd20a15eb 100644 --- a/test/MusicStore.Test/CheckoutControllerTest.cs +++ b/test/MusicStore.Test/CheckoutControllerTest.cs @@ -5,11 +5,11 @@ using System.Security.Claims; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Internal; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Microsoft.Framework.DependencyInjection; +using Microsoft.Framework.Primitives; using MusicStore.Models; using Xunit; @@ -64,14 +64,14 @@ namespace MusicStore.Controllers // FormCollection initialization httpContext.Request.Form = new FormCollection( - new Dictionary() - { { "PromoCode", new string[] { "FREE" } } } + new Dictionary() + { { "PromoCode", new[] { "FREE" } } } ); // UserName initialization var claims = new List { new Claim(ClaimTypes.Name, "TestUserName") }; httpContext.User = new ClaimsPrincipal(new ClaimsIdentity(claims)); - + // DbContext initialization var dbContext = _serviceProvider.GetRequiredService(); var cartItems = CreateTestCartItems( @@ -87,7 +87,7 @@ namespace MusicStore.Controllers DbContext = dbContext, }; controller.ActionContext.HttpContext = httpContext; - + // Act var result = await controller.AddressAndPayment(order, CancellationToken.None); @@ -108,7 +108,7 @@ namespace MusicStore.Controllers // AddressAndPayment action reads the Promo code from FormCollection. context.Request.Form = - new FormCollection(new Dictionary()); + new FormCollection(new Dictionary()); var controller = new CheckoutController(); controller.ActionContext.HttpContext = context; @@ -133,7 +133,7 @@ namespace MusicStore.Controllers // Arrange var context = new DefaultHttpContext(); context.Request.Form = - new FormCollection(new Dictionary()); + new FormCollection(new Dictionary()); var controller = new CheckoutController(); controller.ActionContext.HttpContext = context; diff --git a/test/MusicStore.Test/ShoppingCartControllerTest.cs b/test/MusicStore.Test/ShoppingCartControllerTest.cs index 1e547de0bb..c4b6a1babb 100644 --- a/test/MusicStore.Test/ShoppingCartControllerTest.cs +++ b/test/MusicStore.Test/ShoppingCartControllerTest.cs @@ -11,6 +11,7 @@ using Microsoft.AspNet.Http.Internal; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Microsoft.Framework.DependencyInjection; +using Microsoft.Framework.Primitives; using MusicStore.Models; using MusicStore.ViewModels; using Xunit; @@ -189,7 +190,7 @@ namespace MusicStore.Controllers var tokens = antiForgery.GetTokens(httpContext); // Header initialization for AntiForgery - var headers = new KeyValuePair( + var headers = new KeyValuePair( "RequestVerificationToken", new string[] { tokens.CookieToken + ":" + tokens.FormToken }); httpContext.Request.Headers.Add(headers);