public MegaMergeServiceTests()
 {
     _companyA = Substitute.For<ICompanyUnitOfWork>();
     _companyB = Substitute.For<ICompanyUnitOfWork>();
     _mergedCatalog = Substitute.For<IMergedCatalogUnitOfWork>();
     _megaMergeService = new MegaMergeService(_companyA, _companyB, _mergedCatalog);
 }
Exemplo n.º 2
0
        private IEnumerable <MergedCatalog> GetMergedCatalogs(ICompanyUnitOfWork company, string sourceName)
        {
            var mergedCatalogs =
                company
                .Catalogs
                .GetAll()
                .Select(x =>
                        new MergedCatalog
            {
                SKU         = x.SKU,
                Description = x.Description,
                Source      = sourceName
            })
                .Distinct()
                .ToList();
            var barcodes = company
                           .Barcodes
                           .GetAll()
                           .ToList();

            mergedCatalogs.ForEach(x =>
            {
                x.Barcodes = barcodes
                             .Where(y => y.SKU == x.SKU)
                             .Select(y => y.Barcode)
                             .ToList();
            });

            return(mergedCatalogs);
        }
Exemplo n.º 3
0
 internal GetCompanyCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
Exemplo n.º 4
0
 public BauService(
     ICompanyUnitOfWork companyA,
     ICompanyUnitOfWork companyB
     )
 {
     CompanyA = companyA;
     CompanyB = companyB;
 }
Exemplo n.º 5
0
 internal AssignCustomerToBrokerCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
Exemplo n.º 6
0
 internal ContactCommandBase(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     CompanyUnitOfWork = companyUnitOfWork;
 }
 internal RemoveCustomerFromBrokerCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
Exemplo n.º 8
0
 public MegaMergeService(
     ICompanyUnitOfWork companyA,
     ICompanyUnitOfWork companyB,
     IMergedCatalogUnitOfWork mergedCatalog
     )
 {
     CompanyA      = companyA;
     CompanyB      = companyB;
     MergedCatalog = mergedCatalog;
 }
Exemplo n.º 9
0
        private Catalog SelectCatalogFromCompany(ICompanyUnitOfWork company)
        {
            Console.WriteLine("These are the Catalog B content:");
            var catalogs = company.Catalogs.GetAll();

            catalogs.Dump();
            Console.Write("Please type SKU no:");
            var sku = Console.ReadLine();

            return(catalogs.FirstOrDefault(x => x.SKU == sku));
        }
Exemplo n.º 10
0
        private Supplier InputNewSupplier(ICompanyUnitOfWork company)
        {
            Console.Write("Supplier Name: ");
            var name          = Console.ReadLine();
            var maxSupplierId = Convert.ToInt32(company.Suppliers.GetAll().Max(x => x.Id));
            var supplierId    = (maxSupplierId + 1).ToString("00000");
            var supplier      = new Supplier {
                Id   = supplierId,
                Name = name
            };

            return(supplier);
        }
 public SyncDeleteCompanyContact(ICompanyUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
Exemplo n.º 12
0
 internal CustomerNoteConductor(ICompanyUnitOfWork companyUnitOfWork)
 {
     _companyUnitOfWork = companyUnitOfWork;
 }
Exemplo n.º 13
0
 internal CreateCompanyCommand(ICompanyUnitOfWork companyUnitOfWork) : base(companyUnitOfWork)
 {
 }
Exemplo n.º 14
0
 public BauServiceTests()
 {
     _companyA   = Substitute.For <ICompanyUnitOfWork>();
     _companyB   = Substitute.For <ICompanyUnitOfWork>();
     _bauService = new BauService(_companyA, _companyB);
 }
Exemplo n.º 15
0
 public CompanyService(ICompanyUnitOfWork companyUnitOfWork)
 {
     _companyUnitOfWork = companyUnitOfWork;
 }
Exemplo n.º 16
0
 internal UpdateContactCommand(ICompanyUnitOfWork companyUnitOfWork) : base(companyUnitOfWork)
 {
 }