public void Before_each_test()
            {
                //ServicesRepository servicesRepository = new ServicesRepository(new ScutexEntities());
                //CommonRepository commonRepository = new CommonRepository(new ScutexServiceEntities());

                AsymmetricEncryptionProvider asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                SymmetricEncryptionProvider symmetricEncryptionProvider = new SymmetricEncryptionProvider();
                ObjectSerializationProvider objectSerializationProvider = new ObjectSerializationProvider();
                NumberDataGenerator numberDataGenerator = new NumberDataGenerator();
                PackingService packingService = new PackingService(numberDataGenerator);
                MasterService masterService = new MasterService(commonRepository);

                CommonService commonService = new CommonService();
                KeyPairService keyPairService = new KeyPairService(commonService, commonRepository);

                ServiceStatusProvider serviceStatusProvider = new ServiceStatusProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);
                servicesService = new ServicesService(servicesRepository, serviceStatusProvider, packingService, null, null, null, null, null, null);

                controlService = new ControlService(symmetricEncryptionProvider, keyPairService, packingService, masterService, objectSerializationProvider, asymmetricEncryptionProvider);

                service = new Scutex.Model.Service();
                service.OutboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.InboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.ManagementInboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.ManagementOutboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            }
 public ServiceAdministrationPageViewModel()
 {
     ReturnToMainMenuCommand = new DelegateCommand(o => ReturnToMainMenu());
     Service         = new ServicesService();
     GetServicesTask = new TaskWatcher <ObservableCollection <Service> >(Service.GetAllServices());
     GetServicesTask.Task.GetAwaiter().OnCompleted(() => PopulateBindingData());
 }
Exemple #3
0
        public static void ListCarsLatestServiceBill()
        {
            Service service;
            char    keyEntered;

            do
            {
                keyEntered = ' ';
                string heading = "Show bill for a Car's latest Service";
                MenuHelper.DisplayEnterReg(heading);
                String regNo = Console.ReadLine().ToUpper().Trim();
                service = ServicesService.GetServiceDetailsForCar(regNo, ref keyEntered)
                          .LastOrDefault();
                if (service == null)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (service == null && keyEntered != '0');

            if (service.Id != 0)
            {
                ServiceDisplayHelper.DisplayServiceDetails(service);
            }
        }
Exemple #4
0
        public static void ListPartsReplacedInCar()
        {
            String         regNo;
            List <Service> serviceDetails;
            char           keyEntered;

            do
            {
                keyEntered = ' ';
                string heading = "Parts replaced during Car's Services";
                MenuHelper.DisplayEnterReg(heading);
                regNo          = Console.ReadLine().ToUpper().Trim();
                serviceDetails = ServicesService.GetServiceDetailsForCar(regNo, ref keyEntered);
                if (serviceDetails.Count == 0)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (serviceDetails.Count == 0 && keyEntered != '0');

            if (serviceDetails.Count > 0)
            {
                ServiceDisplayHelper.DisplayPartsReplacedForAllServices(regNo, serviceDetails);
            }
        }
        public ServiceController()
        {
            var contextName             = "FinancialManagerModel";
            IFinancialDataSource source = new EntityDataSource(contextName);

            _service = new ServicesService(source);
        }
Exemple #6
0
        public static void ListServiceMechanicsForReg()
        {
            String         regNo;
            List <Service> serviceDetails = new List <Service>();
            char           keyEntered;

            do
            {
                keyEntered = ' ';
                string heading = "Mechanics who serviced Car";
                MenuHelper.DisplayEnterReg(heading);
                regNo          = Console.ReadLine().ToUpper().Trim();
                serviceDetails = ServicesService.GetServiceDetailsForCar(regNo, ref keyEntered);
                if (serviceDetails.Count == 0)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (serviceDetails.Count == 0 && keyEntered != '0');

            if (serviceDetails.Count > 0)
            {
                ServiceDisplayHelper.DisplayMechanicsWhoServicedCar(regNo, serviceDetails);
                MenuHelper.DisplayPressKeyToReturnToMainMenu();
            }
        }
Exemple #7
0
        public static void ListServicesByAMechanic()
        {
            List <Service> serviceDetails = new List <Service>();
            char           keyEntered;
            int            staffId;

            do
            {
                keyEntered = ' ';
                staffId    = -1;
                MenuHelper.DisplayEnterMechanicId();
                string mechanicIdString = Console.ReadLine().Trim();

                serviceDetails = ServicesService.GetMechanicServiceDetails(ref staffId, mechanicIdString);
                if (staffId == -1)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (staffId == -1 && keyEntered != '0');

            if (staffId != -1)
            {
                DisplayServicesForMechanic(serviceDetails, staffId);
            }
        }
            public void Before_each_test()
            {
                //ServicesRepository servicesRepository = new ServicesRepository(new ScutexEntities());
                //CommonRepository commonRepository = new CommonRepository(new ScutexServiceEntities());

                AsymmetricEncryptionProvider asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                SymmetricEncryptionProvider  symmetricEncryptionProvider  = new SymmetricEncryptionProvider();
                ObjectSerializationProvider  objectSerializationProvider  = new ObjectSerializationProvider();
                NumberDataGenerator          numberDataGenerator          = new NumberDataGenerator();
                PackingService packingService = new PackingService(numberDataGenerator);
                MasterService  masterService  = new MasterService(commonRepository);

                CommonService  commonService  = new CommonService();
                KeyPairService keyPairService = new KeyPairService(commonService, commonRepository);

                ServiceStatusProvider serviceStatusProvider = new ServiceStatusProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);

                servicesService = new ServicesService(servicesRepository, serviceStatusProvider, packingService, null, null, null, null, null, null);


                controlService = new ControlService(symmetricEncryptionProvider, keyPairService, packingService, masterService, objectSerializationProvider, asymmetricEncryptionProvider);

                service = new Scutex.Model.Service();
                service.OutboundKeyPair           = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.InboundKeyPair            = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.ManagementInboundKeyPair  = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
                service.ManagementOutboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            }
 public ServicesController(ILogger <ServicesController> logger,
                           TamContext context,
                           ServicesService service)
 {
     _context = context;
     _logger  = logger;
     _service = service;
 }
 public ServicesController(ServicesRepository servicesRepository, ServicesService servicesService, IMapper mapper, PaginatedMetaService paginatedMetaService, FileHelper fileHelper)
 {
     _servicesRepository   = servicesRepository;
     _servicesService      = servicesService;
     _mapper               = mapper;
     _paginatedMetaService = paginatedMetaService;
     _fileHelper           = fileHelper;
 }
Exemple #11
0
 public OrderResultViewModel(PageManager pageservice,
                             OrderService orderService, BasketService basketService, ServicesService servicesService) : base(pageservice)
 {
     this.orderService    = orderService;
     this.basketService   = basketService;
     this.servicesService = servicesService;
     Init();
 }
Exemple #12
0
 public ServicesViewModel(PageService pageservice,
                          ServicesService servicesService, EventBus eventBus, OrderService orderService) : base(pageservice)
 {
     this.servicesService = servicesService;
     this.eventBus        = eventBus;
     this.orderService    = orderService;
     Init();
 }
        public AddServiceForm()
        {
            InitializeComponent();
            Type                 obj               = Type.GetType(ConfigurationManager.AppSettings["ServicesRep"]);
            ConstructorInfo      constructor       = obj.GetConstructor(new Type[] { });
            InterfaceServicesDAO defaultRepository = (InterfaceServicesDAO)constructor.Invoke(null);

            service = new ServicesService(defaultRepository);
        }
Exemple #14
0
 public BasketViewModel(PageManager pageservice, BasketService basketService,
                        CatalogService catalogService, ServicesService servicesService,
                        OrderService orderService, UserService userService, EventBus eventBus) : base(pageservice)
 {
     this.basketService   = basketService;
     this.catalogService  = catalogService;
     this.servicesService = servicesService;
     this.orderService    = orderService;
     this.userService     = userService;
     this.eventBus        = eventBus;
     Init();
 }
 public AdminController(ILogger <AdminController> logger,
                        TamContext context,
                        ServicesService servicesService,
                        TradeService tradeService,
                        CompanyService companyService)
 {
     _context         = context;
     _logger          = logger;
     _servicesService = servicesService;
     _tradeService    = tradeService;
     _companyService  = companyService;
 }
        private void btnRequestService_Click(object sender, EventArgs e)
        {
            IServicesService servicesService = new ServicesService();
            service          objService      = new service();

            objService.clinicDateId  = dateID;
            objService.description   = txtServiceDescription.Text.ToString();
            objService.dateOfService = dtServices.Value;
            objService.doctorId      = 1;
            objService.dateOfRequest = DateTime.Today;
            objService.status        = false;
            servicesService.createService(objService);
            MessageBox.Show("Servicio created. Wait for confirmation.");
            this.Close();
        }
Exemple #17
0
 /// <summary>
 /// Initializes all the services offered by the current version of
 /// this API.
 /// </summary>
 /// <see cref="IdentityService"/>
 /// <see cref="HttpService"/>
 /// <see cref="OAuth2Service"/>
 private void InitializeServices()
 {
     Http              = new HttpService(RestClientWrapper.RestClient, new RequestBuilder());
     Accounts          = new AccountsService(this);
     Certificates      = new CertificatesService(this);
     Contacts          = new ContactsService(this);
     Domains           = new DomainsService(this);
     Identity          = new IdentityService(this);
     OAuth             = new OAuth2Service(Http);
     Registrar         = new RegistrarService(this);
     Services          = new ServicesService(this);
     Tlds              = new TldsService(this);
     Templates         = new TemplatesService(this);
     VanityNameServers = new VanityNameServersService(this);
     Webhooks          = new WebhooksService(this);
     Zones             = new ZonesService(this);
 }
        public CreateAppointmentForm()
        {
            InitializeComponent();

            Type                 obj               = Type.GetType(ConfigurationManager.AppSettings["ServicesRep"]);
            ConstructorInfo      constructor       = obj.GetConstructor(new Type[] { });
            InterfaceServicesDAO defaultRepository = (InterfaceServicesDAO)constructor.Invoke(null);

            service = new ServicesService(defaultRepository);

            Type                    obj2               = Type.GetType(ConfigurationManager.AppSettings["AppointmentRep"]);
            ConstructorInfo         constructor2       = obj2.GetConstructor(new Type[] { });
            InterfaceAppointmentDAO defaultRepository2 = (InterfaceAppointmentDAO)constructor2.Invoke(null);

            appointment = new AppointmentService(defaultRepository2);
            fillListBox();
        }
Exemple #19
0
        public void SetupService(int clientPort, int mgmtPort)
        {
            SingleUserSetup();

            Service = new Service();
            Service.OutboundKeyPair           = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            Service.InboundKeyPair            = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            Service.ManagementInboundKeyPair  = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            Service.ManagementOutboundKeyPair = asymmetricEncryptionProvider.GenerateKeyPair(BitStrengths.High);
            Service.Token = Guid.NewGuid().ToString();

            StringDataGenerator stringDataGenerator = new StringDataGenerator();

            Service.ClientRequestToken     = stringDataGenerator.GenerateRandomString(10, 25, true, true);
            Service.ManagementRequestToken = stringDataGenerator.GenerateRandomString(10, 25, true, true);

            Service.ClientUrl     = string.Format("http://localhost:{0}/", clientPort);
            Service.ManagementUrl = string.Format("http://localhost:{0}/", mgmtPort);
            Service.Name          = "UnitTest Web Services";
            Service.UniquePad     = Guid.NewGuid();
            Service.Initialized   = false;
            Service.CreatedDate   = DateTime.Now;
            Service.LockToIp      = false;

            wcfPackagingService.WriteClientKeys(Helper.AssemblyDirectory + "\\WebServices\\Client", Service);
            wcfPackagingService.WriteManagementKeys(Helper.AssemblyDirectory + "\\WebServices\\Mgmt", Service);

            try
            {
                _servicesService = new ServicesService(null, serviceStatusProvider, packingService,
                                                       licenseActiviationProvider, service, null, null, clientLicenseService, productsProvider);

                Service.Initialized = _servicesService.InitializeService(Service);

                _servicesService.AddProductToService(License, License.LicenseSets.ToList(), Service);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                throw;
            }

            License.Service = Service;
        }
Exemple #20
0
        public MockDnsimpleClient(string fixture)
        {
            Fixture   = fixture;
            UserAgent = "Testing user agent";

            Accounts          = new AccountsService(this);
            Certificates      = new CertificatesService(this);
            Contacts          = new ContactsService(this);
            Domains           = new DomainsService(this);
            Http              = new MockHttpService("v2", Fixture, BaseUrl);
            Identity          = new IdentityService(this);
            OAuth             = new OAuth2Service(Http);
            Registrar         = new RegistrarService(this);
            Services          = new ServicesService(this);
            Tlds              = new TldsService(this);
            Templates         = new TemplatesService(this);
            VanityNameServers = new VanityNameServersService(this);
            Webhooks          = new WebhooksService(this);
            Zones             = new ZonesService(this);
        }
Exemple #21
0
            public void Before_each_test()
            {
                asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                hashingProvider = new HashingProvider();
                objectSerializationProvider = new ObjectSerializationProvider();
                numberDataGenerator = new NumberDataGenerator();
                packingService = new PackingService(numberDataGenerator);
                servicesService = new ServicesService(null, null, packingService, null, null, null, null, null, null);

                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
                path = path.Replace("file:\\", "");

                string serviceData;

                using (TextReader reader = new StreamReader(path + "\\Data\\Service.dat"))
                {
                    serviceData = reader.ReadToEnd().Trim();
                }

                service = objectSerializationProvider.Deserialize<Service>(serviceData);
            }
Exemple #22
0
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            Service service = new Service()
            {
                ServiceID   = Guid.NewGuid(),
                Name        = txtName.Text,
                Description = txtDescription.Text,
                PriceGross  = decimal.Parse(txtPriceGross.Text, System.Globalization.CultureInfo.InvariantCulture)
            };

            if (IsCreateMode)
            {
                service = new ServicesService().create(service);
                Response.Redirect(string.Format("/Pages/ServiceDetails.aspx?ServiceID={0}", service.ServiceID.ToString()));
            }
            else
            {
                service.ServiceID = this.ServiceID;
                new ServicesService().update(service);
            }
        }
Exemple #23
0
            public void Before_each_test()
            {
                asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                hashingProvider             = new HashingProvider();
                objectSerializationProvider = new ObjectSerializationProvider();
                numberDataGenerator         = new NumberDataGenerator();
                packingService  = new PackingService(numberDataGenerator);
                servicesService = new ServicesService(null, null, packingService, null, null, null, null, null, null);

                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);

                path = path.Replace("file:\\", "");

                string serviceData;

                using (TextReader reader = new StreamReader(path + "\\Data\\Service.dat"))
                {
                    serviceData = reader.ReadToEnd().Trim();
                }

                service = objectSerializationProvider.Deserialize <Service>(serviceData);
            }
 //        readonly string[] _list = {
 //                                "AFP-EdiDocumentsIn", "AFP-EdiDocumentsOut", "EDI Invoice Service",
 //                                "Email Service", "MassTransit.RuntimeServices",
 //                                "Process FedEx Shipments", "Process LabelPrintRequestMessage",
 //                                "Process OrderRequestReceivedMessages", "Process ShipRequestMessages",
 //                                "Set Shipped List"
 //                            };
 public ActionResult Index(string queueName)
 {
     var qRepo = new MSMQRepository();
     try
     {
         ViewData["errorQueues"] = qRepo.FindWhere("automation2", q => q.QueueName.EndsWith("error") && q.GetAllMessages().Count() > 0);
     }
     catch (Exception ex)
     {
         ViewData["ErrorMessage"] = ex.ToString();
     }
     var ss = new ServicesService();
     try
     {
         ViewData["servicelist"] = ss.GetServicesOn("automation2").Where(s => s.Name.StartsWith("AFP"));
     }
     catch (Exception ex)
     {
         ViewData["ErrorMessage"] += ex.ToString();
     }
     return View();
 }
Exemple #25
0
        private void bindService()
        {
            if (!IsCreateMode)
            {
                Service service = new ServicesService().getByID(this.ServiceID);

                if (service == null)
                {
                    Response.Redirect("/Pgaes/ServiceList.aspx");
                }
                else
                {
                    txtName.Text        = service.Name;
                    txtDescription.Text = service.Description;
                    txtPriceGross.Text  = service.PriceGross.ToString(System.Globalization.CultureInfo.InvariantCulture);
                    btnDelete.Visible   = true;
                }
            }
            else
            {
                btnDelete.Visible = false;
            }
        }
Exemple #26
0
        public static void ListDetailsForAService()
        {
            Service service = new Service();
            char    keyEntered;

            do
            {
                keyEntered = ' ';
                MenuHelper.DisplayEnterServiceId();
                string serviceIdString = Console.ReadLine().Trim();

                service = ServicesService.GetServiceByIdString(serviceIdString);
                if (service.Id == 0)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (service.Id == 0 && keyEntered != '0');

            if (service.Id != 0)
            {
                ServiceDisplayHelper.DisplayServiceDetails(service);
            }
        }
            public void Before_each_test()
            {
                clientLicenseRepoistory      = new ClientLicenseRepository(objectSerializationProvider, symmetricEncryptionProvider);
                clientLicenseService         = new ClientLicenseService(clientLicenseRepoistory);
                serviceProductsRepository    = new ServiceProductsRepository(new ScutexServiceEntities());
                symmetricEncryptionProvider  = new SymmetricEncryptionProvider();
                asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                hashingProvider             = new HashingProvider();
                objectSerializationProvider = new ObjectSerializationProvider();
                numberDataGenerator         = new NumberDataGenerator();
                packingService             = new PackingService(numberDataGenerator);
                commonRepository           = new CommonRepository(new ScutexServiceEntities());
                clientRepository           = new ClientRepository(new ScutexServiceEntities());
                keyGenerator               = new KeyGenerator(symmetricEncryptionProvider, asymmetricEncryptionProvider, hashingProvider);
                masterService              = new MasterService(commonRepository);
                hardwareFingerprintService = new HardwareFingerprintService(new WmiDataProvider(), new HashingProvider());
                keyGeneratorLarge          = new Scutex.Generators.StaticKeyGeneratorLarge.KeyGenerator(symmetricEncryptionProvider, asymmetricEncryptionProvider, hashingProvider, hardwareFingerprintService);

                var mockActivationLogRepository = new Mock <IActivationLogRepoistory>();

                mockActivationLogRepository.Setup(log => log.SaveActivationLog(It.IsAny <Scutex.Model.ActivationLog>()));

                activationLogService = new ActivationLogService(mockActivationLogRepository.Object, hashingProvider);
                commonService        = new CommonService();

                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);

                path = path.Replace("file:\\", "");

                var mockCommonService = new Mock <ICommonService>();

                mockCommonService.Setup(common => common.GetPath()).Returns(path + "\\Data\\Client\\");

                string masterServiceDataText;

                using (TextReader reader = new StreamReader(path + "\\Data\\MasterService.dat"))
                {
                    masterServiceDataText = reader.ReadToEnd().Trim();
                }

                masterServiceData = objectSerializationProvider.Deserialize <MasterServiceData>(masterServiceDataText);

                var mockCommonRepository = new Mock <ICommonRepository>();

                mockCommonRepository.Setup(repo => repo.GetMasterServiceData()).Returns(masterServiceData);

                masterService = new MasterService(mockCommonRepository.Object);

                keyPairService             = new KeyPairService(mockCommonService.Object, mockCommonRepository.Object);
                controlService             = new ControlService(symmetricEncryptionProvider, keyPairService, packingService, masterService, objectSerializationProvider, asymmetricEncryptionProvider);
                servicesRepository         = new ServicesRepository(new ScutexEntities());
                serviceStatusProvider      = new ServiceStatusProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);
                licenseActiviationProvider = new LicenseActiviationProvider(asymmetricEncryptionProvider, symmetricEncryptionProvider, objectSerializationProvider);
                servicesService            = new ServicesService(servicesRepository, serviceStatusProvider, packingService, licenseActiviationProvider, null, null, null, null, null);
                licenseKeyService          = new LicenseKeyService(keyGenerator, keyGeneratorLarge, packingService, clientLicenseService);
                keyService        = new KeyManagementService(clientRepository, licenseKeyService, activationLogService, hashingProvider, serviceProductsRepository);
                activationService = new ActivationService(controlService, keyService, keyPairService, objectSerializationProvider, asymmetricEncryptionProvider, activationLogService, masterService, commonService, null);

                string serviceData;

                using (TextReader reader = new StreamReader(path + "\\Data\\Service.dat"))
                {
                    serviceData = reader.ReadToEnd().Trim();
                }

                service = objectSerializationProvider.Deserialize <Service>(serviceData);
            }
Exemple #28
0
 public KeyController(KeyService keyService, ServicesService servicesService)
 {
     _keyService      = keyService;
     _servicesService = servicesService;
 }
Exemple #29
0
 public ServicesController()
 {
     _ServicesService = new ServicesService();
 }
        private static bool ServiceExists(int serviceId)
        {
            var service = ServicesService.GetServiceById(serviceId);

            return(service != null);
        }
 public Services()
 {
     _servicesService = new ServicesService();
 }
            public void Before_each_test()
            {
                clientLicenseRepoistory = new ClientLicenseRepository(objectSerializationProvider, symmetricEncryptionProvider);
                clientLicenseService = new ClientLicenseService(clientLicenseRepoistory);
                serviceProductsRepository = new ServiceProductsRepository(new ScutexServiceEntities());
                symmetricEncryptionProvider = new SymmetricEncryptionProvider();
                asymmetricEncryptionProvider = new AsymmetricEncryptionProvider();
                hashingProvider = new HashingProvider();
                objectSerializationProvider = new ObjectSerializationProvider();
                numberDataGenerator = new NumberDataGenerator();
                packingService = new PackingService(numberDataGenerator);
                commonRepository = new CommonRepository(new ScutexServiceEntities());
                clientRepository = new ClientRepository(new ScutexServiceEntities());
                keyGenerator = new KeyGenerator(symmetricEncryptionProvider, asymmetricEncryptionProvider, hashingProvider);
                masterService = new MasterService(commonRepository);
                activationLogRepository = new ActivationLogRepoistory(new ScutexServiceEntities());

                activationLogService = new ActivationLogService(activationLogRepository, hashingProvider);
                keyService = new KeyManagementService(clientRepository, licenseKeyService, activationLogService, hashingProvider, serviceProductsRepository);
                commonService = new CommonService();

                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
                path = path.Replace("file:\\", "");

                var mockCommonService = new Mock<ICommonService>();
                mockCommonService.Setup(common => common.GetPath()).Returns(path + "\\Data\\Client\\");

                string masterServiceDataText;

                using (TextReader reader = new StreamReader(path + "\\Data\\MasterService.dat"))
                {
                    masterServiceDataText = reader.ReadToEnd().Trim();
                }

                masterServiceData = objectSerializationProvider.Deserialize<MasterServiceData>(masterServiceDataText);

                var mockCommonRepository = new Mock<ICommonRepository>();
                mockCommonRepository.Setup(repo => repo.GetMasterServiceData()).Returns(masterServiceData);

                keyPairService = new KeyPairService(mockCommonService.Object, mockCommonRepository.Object);
                controlService = new ControlService(symmetricEncryptionProvider, keyPairService, packingService, masterService, objectSerializationProvider, asymmetricEncryptionProvider);
                servicesRepository = new ServicesRepository(new ScutexEntities());
                serviceStatusProvider = new ServiceStatusProvider(symmetricEncryptionProvider, objectSerializationProvider, asymmetricEncryptionProvider);
                licenseActiviationProvider = new LicenseActiviationProvider(asymmetricEncryptionProvider, symmetricEncryptionProvider, objectSerializationProvider);
                servicesService = new ServicesService(servicesRepository, serviceStatusProvider, packingService, licenseActiviationProvider, null, null, null, null, null);
                licenseKeyService = new LicenseKeyService(keyGenerator, packingService, clientLicenseService);
                activationService = new ActivationService(controlService, keyService, keyPairService, objectSerializationProvider, asymmetricEncryptionProvider, null, null);

                string serviceData;

                using (TextReader reader = new StreamReader(path + "\\Data\\Service.dat"))
                {
                    serviceData = reader.ReadToEnd().Trim();
                }

                service = objectSerializationProvider.Deserialize<Service>(serviceData);
            }
Exemple #33
0
 public ServicesController(ServicesService servicesService)
 {
     _servicesService = servicesService;
 }
Exemple #34
0
    public void Setup()
    {
        _employeeRepository = A.Fake <IEmployeesRepository>();

        _serviceService = new ServicesService(_employeeRepository);
    }