Skip to content

Instantly share code, notes, and snippets.

@jfromaniello
Created November 27, 2009 02:04
Show Gist options
  • Save jfromaniello/243777 to your computer and use it in GitHub Desktop.
Save jfromaniello/243777 to your computer and use it in GitHub Desktop.
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