public ActivationIntegrationEventHandler(IActivationRepository repository, IActivationFactory factory, IUnitOfWork <ILedgerActivationDbAbstraction> unitOfWork, IEmailDispatcher emailDispatcher) { _unitOfWork = unitOfWork; _repository = repository; _factory = factory; _emailDispatcher = emailDispatcher; }
//Constructor public ProductTypeRepositoryTest() { //mock data for productType entity IList <ProductType> types = new List <ProductType>() { new ProductType { Id = 1, Type = "BVMS" }, new ProductType { Id = 2, Type = "CDR" } }; //initial the mock product type repository using Moq mockProductTypeRepo = new Mock <IProductTypeRepository>(); //access mock instance //this.MockProductTypeRepo = mockProductTypeRepo.Object; //set up GetAll method //mockProductTypeRepo.Setup(mp => mp.GetAll()).Returns(types.AsQueryable()); //set up GetById method mockProductTypeRepo.Setup(mp => mp.GetById(It.IsAny <int>())).Returns((int i) => types.Where(x => x.Id == i).Single()); //set up create method mockProductTypeRepo.Setup(mp => mp.Insert(It.IsAny <ProductType>())).Returns(true); //mock data for license entity IList <License> ListOfMatchinglicenses = new List <License>() { new License { Id = 1, Name = "BVMS Lite-64 edition v2.0", Description = "this is a test.", TitleOfHardware = "Computer Signature", LicenseType = LicenseType.Subscription, Duration = 1, DateCreated = DateTime.Now, DateUpdated = DateTime.Now, Status = Status.Valid, ProdFamilyId = 1, SubscriptionId = 1, VersionId = 1, ApplicationId = 1, ProductTypeId = 1 }, new License { Id = 2, Name = "BVMS 2 Camera Extension", Description = "test test test.", TitleOfHardware = "Computer Signature", LicenseType = LicenseType.Subscription, Duration = 1, DateCreated = DateTime.Now, DateUpdated = DateTime.Now, Status = Status.Invalid, ProdFamilyId = 1, SubscriptionId = 1, VersionId = 2, ApplicationId = 1, ProductTypeId = 1 }, new License { Id = 3, Name = "CDR V3.6, 1 Year Subscription", Description = "this is for VLMS.", TitleOfHardware = "CDR Vehicle Interface Module", LicenseType = LicenseType.Subscription, Duration = 1, DateCreated = DateTime.Now, DateUpdated = DateTime.Now, Status = Status.Valid, ProdFamilyId = 10, SubscriptionId = 1, VersionId = 6, ApplicationId = 2, ProductTypeId = 2 } }; //initial the mock license repository mockLicenseRepo = new Mock <ILicenseRepository>(); //access the mock instance this.MockLicenseRepo = mockLicenseRepo.Object; //set up GetLicensesByProductTypeId //mockLicenseRepo.Setup(m => m.GetLicensesByProductTypeId(It.IsAny<int>())).Returns(licenses); mockLicenseRepo.Setup(m => m.GetLicensesByProductTypeId(It.IsAny <int>() )).Returns((int i) => ListOfMatchinglicenses.Where(x => x.ProductTypeId == i)); mockActivationRepo = new Mock <IActivationRepository>(); this.MockActivationRepo = mockActivationRepo.Object; //mock data for authorization }
public ActivationService(IUserRepository userRepository, IAuthenticationService authenticationService, IActivationRepository activationRepository) { _userRepository = userRepository; _authenticationService = authenticationService; _activationRepository = activationRepository; }
public ActivationApplicationService(IActivationRepository repository, IIdentityResolver identityResolver, IDomainNotificationHandler domainNotificationHandler, IUnitOfWork <ILedgerActivationDbAbstraction> unitOfWork, IIntegrationServiceBus integrationBus, IDomainServiceBus domainBus) : base(domainNotificationHandler, unitOfWork, integrationBus, domainBus) { _repository = repository; _identityResolver = identityResolver; }
public ActivationService(IActivationRepository activationRepository) { _activationRepository = activationRepository; }
public ActivationController(IActivationRepository repo) : base(repo) { }
public BaseApiController(IActivationRepository activationRepo) { _theActivationRepo = activationRepo; }
public UserProfileService(IActivationRepository activationRepository, IUserProfileRepository userProfileRepository) { _activationRepository = activationRepository; _userProfileRepository = userProfileRepository; }
public ModelFactory(HttpRequestMessage request, IActivationRepository repo) { _iactivationRepo = repo; _urlHelper = new UrlHelper(request); }
public ActivationService(IUserRepository userRepository, IAuthenticationService authenticationService, IActivationRepository activationRepository) { _userRepository = userRepository; _authenticationService = authenticationService; _activationRepository = activationRepository; }