Пример #1
0
        public void Articulo_GetById_Fail()
        {
            var mock            = new Mock <Infra.IArticuloInfrastructure>();
            var articuloManager = new Core.Managers.Articulo(mock.Object, null);

            var target = ArticuloOutputFactory.Get();

            mock.Setup(x => x.GetById(target.Id))
            .Returns(target);

            var art = articuloManager.GetById(target.Id - 1);

            Assert.Null(art);
        }
Пример #2
0
        public void Articulo_GetById_Assert()
        {
            var mock            = new Mock <Infra.IArticuloInfrastructure>();
            var articuloManager = new Core.Managers.Articulo(mock.Object, null);
            var target          = ArticuloOutputFactory.Get();

            mock.Setup(x => x.GetById(target.Id))
            .Returns((int value) => target);

            var item = articuloManager.GetById(target.Id);

            Assert.AreEqual(target.Activo, item.Activo);
            Assert.AreEqual(target.Descripcion, item.Descripcion);
            Assert.AreEqual(target.Id, item.Id);

            Assert.AreEqual(target.Lote, item.Lote);
            Assert.AreEqual(target.Marca, item.Marca);
            Assert.AreEqual(target.NumeroSerie, item.NumeroSerie);
            Assert.AreEqual(target.Precio, item.Precio);
            Assert.AreEqual(target.Tipo, item.Tipo);
            Assert.AreEqual(target.UsuarioAdjudicado, item.UsuarioAdjudicado);
            Assert.AreEqual(target.UsuariosInteresados, item.UsuariosInteresados);
        }