Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
namespace ModernWebStore.Tests.Domain.Specs
{
[TestClass]
public class ProductSpecTests
{
private List<Product> _products;
public ProductSpecTests()
{
this._products = new List<Product>();
_products.Add(new Product("Produto 1", "Descricao", 29, 0, 1));
_products.Add(new Product("Produto 2", "Descricao", 129, 1, 1));
_products.Add(new Product("Produto 3", "Descricao", 229, 2, 1));
_products.Add(new Product("Produto 4", "Descricao", 329, 0, 1));
_products.Add(new Product("Produto 5", "Descricao", 429, 3, 1));
}
[TestMethod]
[TestCategory("Product Specs - GetProductsInStock")]
public void ShouldReturnThreeWhenGetProductsInStock()
{
var exp = ProductSpecs.GetProductsInStock();
var user = _products.AsQueryable().Where(exp).FirstOrDefault();
Assert.AreNotEqual(null, user);
}
[TestMethod]
[TestCategory("Product Specs - GetProductsOutOfStock")]
public void ShouldReturnTwoWhenGetProductsOutOfStock()
{
var exp = ProductSpecs.GetProductsOutOfStock();
var user = _products.AsQueryable().Where(exp).FirstOrDefault();
Assert.AreNotEqual(null, user);
}
}
}

Fiz uma revisão, veja se interessa fazer commit no seu arquivo.
https://gist.github.com/thiagolunardi/397e4b6d5273c7dc231b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment