public void execute_validGremio_deleteGremio() { var gremioDeleted = new Gremio(getRTN("08011985123960"), getRepresentanteLegal("0801198512396"), getDireccion("01", "01", "01", "Barrio"), "Camara"); var repositoryRead = Mock.Of <IGremioRepositoryReadOnly>(); Mock.Get(repositoryRead).Setup(x => x.exists(It.IsAny <RTN>())).Returns(true); Mock.Get(repositoryRead).Setup(x => x.get(It.IsAny <RTN>())).Returns(gremioDeleted); var repository = Mock.Of <IGremioRepositoryCommands>(); var uow = Mock.Of <Func <IUnitOfWork> >(); Mock.Get(uow).Setup(x => x()).Returns(new DummyUnitOfWork()); var command = new CommandDeleteGremio(repositoryRead, repository, uow); command.execute(gremioDeleted.Id); Mock.Get(repository).Verify(x => x.delete(gremioDeleted)); }