Refactoring and Adding Tests (#58)

* Moving Identity seeding to its own class and method.

* Adding tests for AddItem

* Added catalog api controller and functional tests
Added and cleaned up some comments

* Adding integration tests for OrderRepository

* Getting integration test for order working with inmemory db
This commit is contained in:
Steve Smith
2017-10-20 12:52:42 -04:00
committed by GitHub
parent 32950aa175
commit 0eb4d72b89
17 changed files with 306 additions and 94 deletions

View File

@@ -1,5 +1,7 @@
namespace Microsoft.eShopWeb.ApplicationCore.Entities
{
// This can easily be modified to be BaseEntity<T> and public T Id to support different key types.
// Using non-generic integer types for simplicity and to ease caching logic
public class BaseEntity
{
public int Id { get; set; }

View File

@@ -5,6 +5,5 @@
public decimal UnitPrice { get; set; }
public int Quantity { get; set; }
public int CatalogItemId { get; set; }
// public CatalogItem Item { get; set; }
}
}

View File

@@ -1,29 +0,0 @@
using System;
namespace ApplicationCore.Exceptions
{
/// <summary>
/// Note: No longer required.
/// </summary>
public class CatalogImageMissingException : Exception
{
public CatalogImageMissingException(string message,
Exception innerException = null)
: base(message, innerException: innerException)
{
}
public CatalogImageMissingException(Exception innerException)
: base("No catalog image found for the provided id.",
innerException: innerException)
{
}
public CatalogImageMissingException() : base()
{
}
public CatalogImageMissingException(string message) : base(message)
{
}
}
}

View File

@@ -12,7 +12,6 @@ namespace ApplicationCore.Services
public string ComposePicUri(string uriTemplate)
{
return uriTemplate.Replace("http://catalogbaseurltobereplaced", _catalogSettings.CatalogBaseUrl);
}
}
}