Ejemplo n.º 1
0
 public ReceipeServices(ILogger <ReceipeServices> logger, IServiceRepo serviceRepo,
                        IMapper mapper)
 {
     this.logger      = logger;
     this.serviceRepo = serviceRepo;
     this.mapper      = mapper;
 }
        public void GetService_for_default_types()
        {
            //arrange
            IServiceRepo svcRepo = ServiceRepo.Instance;

            //act
            var notificationMgr = svcRepo.GetService(typeof(INotificationManager <JobId>));
            var anotherMgr      = svcRepo.GetService(typeof(INotificationManager <JobId>));

            var handler       = svcRepo.GetService(typeof(IHookHandler <JobId>));
            var sRuntime      = svcRepo.GetService(typeof(SequentialRuntime));
            var tRuntime      = svcRepo.GetService(typeof(TaskRuntime));
            var thread        = svcRepo.GetService(typeof(IWorkflowThread <JobResult>));
            var anotherThread = svcRepo.GetService(typeof(IWorkflowThread <JobResult>));
            var sHost         = svcRepo.GetService(typeof(IWorkflowHost <SequentialRuntime>));
            var tHost         = svcRepo.GetService(typeof(IWorkflowHost <TaskRuntime>));

            //assert
            Assert.NotNull(notificationMgr);
            Assert.NotNull(anotherMgr);
            Assert.Same(notificationMgr, anotherMgr);
            Assert.IsType(notificationMgr.GetType(), anotherMgr);
            Assert.NotNull(handler);
            Assert.NotNull(sRuntime);
            Assert.NotNull(tRuntime);
            Assert.NotNull(thread);
            Assert.NotSame(thread, anotherThread);
            Assert.IsType(thread.GetType(), anotherThread);
            Assert.NotNull(sHost);
            Assert.NotNull(tHost);
        }
Ejemplo n.º 3
0
        public SubscriptionService(ISubscriptionLogRepo subscriptionLogRepo, IServiceRepo subscriptionRepo)
        {
            OrcusSMEContext context = new OrcusSMEContext(new DbContextOptions <OrcusSMEContext>());

            _subscriptionLogRepo = subscriptionLogRepo;
            _subscriptionRepo    = subscriptionRepo;
            _crashLogRepo        = new CrashLogRepo(context);
        }
Ejemplo n.º 4
0
 public UiController(UserManager <ApplicationUser> userManager,
                     RoleManager <IdentityRole> roleManager,
                     SignInManager <ApplicationUser> signInManager,
                     IServiceRepo serviceRepo, IRotaService rotaService)
 {
     _identityRepo = new IdentityRepo(userManager, roleManager, signInManager);
     _serviceRepo  = serviceRepo;
     _rotaService  = rotaService;
 }
        public void GetService_with_null_check()
        {
            //arrange
            IServiceRepo svcRepo = ServiceRepo.Instance;

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => svcRepo.GetService(null));
        }
        public void GetService_should_return_null()
        {
            //arrange
            IServiceRepo svcRepo = ServiceRepo.Instance;

            //act
            var refNull = svcRepo.GetService(typeof(Xunit.Assert));

            //assert
            Assert.Null(refNull);
        }
        public void Instance_with_default()
        {
            //arrange
            IServiceRepo serviceRepo = null;

            //act
            serviceRepo = ServiceRepo.Instance;

            //assert
            Assert.NotNull(serviceRepo);
        }
        public void GetServiceOf_should_return_null()
        {
            //arrange
            IServiceRepo svcRepo = ServiceRepo.Instance;

            //act
            var refNull  = svcRepo.GetServiceOf <Xunit.Assert>();
            var refNull1 = svcRepo.GetServiceOf <object>();

            //assert
            Assert.Null(refNull);
            Assert.Null(refNull1);
        }
Ejemplo n.º 9
0
 public ServiceNameUniqueSpecification(IServiceRepo repo)
 {
     this.repo = repo;
 }
Ejemplo n.º 10
0
 public ServiceManager(IServiceRepo repo)
 {
     _repo = repo;
 }
 public ProviderServiceManager(IServiceRepo repo)
 {
     Repo = repo;
 }
Ejemplo n.º 12
0
 public ServiceService(IServiceRepo repo, ServiceNameUniqueSpecification uniqueNameSpec, ServiceNotInUseSpecification notInUseSpec)
 {
     this.repo           = repo;
     this.uniqueNameSpec = uniqueNameSpec;
     this.notInUseSpec   = notInUseSpec;
 }