Ejemplo n.º 1
0
        public override async Task <ISupplierData> CreateSupplierAsync(SupplierViewObject viewObject)
        {
            ISupplierData data = await _services.GetSupplierDataServices().GetAsyncSupplierDo(viewObject.NUM_PROVEE).ConfigureAwait(false);

            data.Value = viewObject;
            return(data);
        }
Ejemplo n.º 2
0
 public Supplier(ISqlExecutor executor, IMapper mapper, SupplierPoco supplierPoco, SupplierViewObject viewObject)
 {
     _supplierValue      = supplierPoco;
     _supplierViewObject = viewObject;
     _sqlExecutor        = executor;
     _supplierMapper     = mapper;
 }
        public async Task Should_Insert_And_Save_A_Supplier()
        {
            string             id         = _supplierDataServices.GetNewId();
            ISupplierData      data       = _supplierDataServices.GetNewSupplierDo(id);
            SupplierViewObject viewObject = data.Value;

            viewObject.NOMBRE = "GenericSupplier";
            data.Value        = viewObject;
            bool value = await _supplierDataServices.Save(data);

            Assert.True(value);
        }
        public async Task Should_Insert_NewSupplierWithAllFields()
        {
            Dictionary <string, object> mapperProperties = new Dictionary <string, object>();
            // arrange
            var supplierCollection = await _supplierDataServices.GetSupplierAsyncSummaryDo();

            var codeId = supplierCollection.FirstOrDefault()?.Codigo;
            // act
            var supplier = await _supplierDataServices.GetAsyncSupplierDo(codeId);

            SupplierViewObject value = supplier.Value;

            value.NOMBRE    = "GZopSoft";
            value.DIRECCION = "Calle Paris 39";
            value.POBLACION = "VITORIA-GASTEITZ";

            // assert
            //Assert.True(supplier.Valid);
            //Assert.NotNull(supplier.Value);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///  Create a domain wrapper for the supplier data transfer object.
        /// </summary>
        /// <param name="viewObject">Data Transfer object</param>
        /// <returns></returns>
        public virtual async Task <ISupplierData> CreateSupplierAsync(SupplierViewObject viewObject)
        {
            ISupplierData data = await _services.GetSupplierDataServices().GetAsyncSupplierDo(viewObject.NUM_PROVEE);

            return(data);
        }