Created
November 27, 2009 02:04
-
-
Save jfromaniello/243777 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var factura = new FacturaPedido(); | |
var daoFacturaPedido = new Mock<IDao<FacturaPedido>>(); | |
var aspecto1 = new Mock<IAspecto<FacturaPedido>>(); | |
aspecto1.Setup(a => a.Aplica(factura)).Returns(true); | |
var aspecto2 = new Mock<IAspecto<FacturaPedido>>(); | |
aspecto2.Setup(a => a.Aplica(factura)).Returns(false); | |
var modelo = new ModeloFacturaPedido(new[] {aspecto1.Object, aspecto2.Object}, | |
new DaoFactoryMock().PushDao(daoFacturaPedido.Object), | |
Stub.This<IEntityFactory>()); | |
modelo.Guardar(factura); | |
aspecto1.VerifyAll(); | |
aspecto2.VerifyAll(); | |
aspecto2.Verify(a => a.Aplicar(factura), Times.Never()); | |
aspecto1.Verify(a => a.Aplicar(factura)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment