Created
July 7, 2015 22:51
-
-
Save andrebaltieri/278d95cf14c91d537ee7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fiz uma revisão, veja se interessa fazer commit no seu arquivo.
https://gist.github.com/thiagolunardi/397e4b6d5273c7dc231b