AdventureWorks.WebServices.Tests.Controllers.ShoppingCartControllerFixture.DeleteShoppingCart_Throws_ForUnknownUser C# (CSharp) Method

DeleteShoppingCart_Throws_ForUnknownUser() private method

private DeleteShoppingCart_Throws_ForUnknownUser ( ) : void
return void
        public void DeleteShoppingCart_Throws_ForUnknownUser()
        {
            var shoppingCartRepository = new MockShoppingCartRepository();
            shoppingCartRepository.DeleteDelegate = s => false;

            HttpResponseException caughtException = null;
            var target = new ShoppingCartController(shoppingCartRepository, new MockProductRepository());
            try
            {
                target.DeleteShoppingCart("UnknownUser");
            }
            catch (HttpResponseException ex)
            {
                caughtException = ex;
            }
            Assert.AreEqual(System.Net.HttpStatusCode.NotFound, caughtException.Response.StatusCode);
        }