Exemple #1
0
 public InformationModule(InformationService service, CommandService commands, IServiceProvider provider)
 {
     _service = service;
     _service.SetParentModule(this);
     _commands = commands;
     _provider = provider;
 }
        public async Task CanWeFindARouteAndGetAPage()
        {
            var informationService = new InformationService
            {
                Address = "www.google.com",
                Port    = 80
            };

            var router  = BuildRouter();
            var service = new Service(null, null);

            service.Initialise("service1", "node1", new[] { UrlPrefix + "/search" }, "www.google.com", 80);
            router.AddNewService(service);

            var context = new DefaultHttpContext();

            context.Request.Method = "GET";
            context.Request.Path   = "/search";

            var routeData    = new RouteData();
            var routeContext = new RouteContext(context)
            {
                RouteData = routeData
            };

            await router.RouteAsync(routeContext);

            await routeContext.Handler.Invoke(routeContext.HttpContext);

            Assert.Equal(200, routeContext.HttpContext.Response.StatusCode);
        }
Exemple #3
0
 public InstructionsController(ApplicationDbContext context, UserManager <ApplicationUser> userManager, FilesService files, InformationService info)
 {
     _context     = context;
     _userManager = userManager;
     _files       = files;
     _info        = info;
 }
        public void ReturnProperlyResult_When_InformationList_IsNotEmpty()
        {
            // Arange
            var entityList   = new List <Information>();
            var mockedEntity = new Mock <InformationTransitional>();

            var expected = new List <InformationTransitional>();

            expected.Add(mockedEntity.Object);

            var mockedMapper = new Mock <IAutoMapperService>();

            mockedMapper
            .Setup(x => x.Map <IEnumerable <InformationTransitional> >(It.IsAny <IEnumerable <Information> >()))
            .Returns(expected);

            var mockedEfDbContext     = new Mock <IEfDbContextSaveChanges>();
            var mockedIEfDbRepository = new Mock <IPhotoArtSystemEfDbRepository <Information> >();

            mockedIEfDbRepository.Setup(x => x.GetAll()).Returns(entityList.AsQueryable());

            var service = new InformationService(mockedMapper.Object, mockedEfDbContext.Object, mockedIEfDbRepository.Object);

            // Act
            var actual = service.GetAll();

            // Assert
            Assert.AreSame(expected[0], actual.ToList()[0]);
        }
 public LoginModel(SignInManager <ApplicationUser> signInManager, ILogger <LoginModel> logger, ApplicationDbContext context, InformationService info)
 {
     _signInManager = signInManager;
     _logger        = logger;
     _context       = context;
     _info          = info;
 }
        public async Task CanWeFindARouteAndGetAPageHttps()
        {
            var informationService = new InformationService
            {
                Address = "www.google.com",
                Port    = 80
            };

            var router     = BuildRouter();
            var routerData = new RoutingData(null);
            var service    = new Service(null, null, routerData);
            await service.Initialise("service1", "node1", new[] { UrlPrefix + "/search", "protocolScheme-https" }, "www.google.com", 443);

            router.AddNewService(service);

            var context = new DefaultHttpContext();

            context.Request.Method = "GET";
            context.Request.Path   = "/search";

            var routedService = router.GetServiceFromRoute(context.Request.Path, out string matchedPath);
            await routedService.CallService(context);

            Assert.Equal(200, context.Response.StatusCode);
        }
Exemple #7
0
        public void ReturnProperlyResult_From_EfDbRepository()
        {
            // Arange
            Fixture fixture              = new Fixture();
            var     id                   = fixture.Create <Guid>();
            var     mockedEntity         = new Mock <Information>();
            var     expectedMockedEntity = new Mock <InformationTransitional>();
            var     mockedMapper         = new Mock <IAutoMapperService>();

            mockedMapper
            .Setup(x => x.Map <InformationTransitional>(It.IsAny <Information>()))
            .Returns(expectedMockedEntity.Object);

            var mockedEfDbContext     = new Mock <IEfDbContextSaveChanges>();
            var mockedIEfDbRepository = new Mock <IPhotoArtSystemEfDbRepository <Information> >();

            mockedIEfDbRepository.Setup(x => x.GetById(id)).Returns(mockedEntity.Object);

            var service = new InformationService(mockedMapper.Object, mockedEfDbContext.Object, mockedIEfDbRepository.Object);

            // Act
            var actual = service.GetById(id);

            // Assert
            Assert.AreSame(expectedMockedEntity.Object, actual);
        }
 public PaymentController(ApplicationDbContext context, AccessService access, CourseService courseService, PaymentService paymentService, EmailService email, InformationService info)
 {
     _context        = context;
     _access         = access;
     _courseService  = courseService;
     _paymentService = paymentService;
     _email          = email;
     _info           = info;
 }
        public List <Int32> getAdIdsWithUserid(Int32 Userid)
        {
            List <Int32> adList = new List <Int32>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            adList = obj.getAdIdsWithUserid(Userid);
            return(adList);
        }
        public void CanRegisterInformation()
        {
            var service = new InformationService();
            service.Load("CommonLibrary.Web.Modules.Tests");

            Assert.AreEqual(service.Lookup.Count, 1);
            Assert.IsNotNull(service.Lookup["InfoTask.Test1"]);
            Assert.IsNotNull(service.Create("InfoTask.Test1"));
            Assert.AreEqual(service.Create("InfoTask.Test1").GetInfo(), "Testing information task");
        }
        public void CanRegisterInformation()
        {
            var service = new InformationService();

            service.Load("CommonLibrary.Web.Modules.Tests");

            Assert.AreEqual(service.Lookup.Count, 1);
            Assert.IsNotNull(service.Lookup["InfoTask.Test1"]);
            Assert.IsNotNull(service.Create("InfoTask.Test1"));
            Assert.AreEqual(service.Create("InfoTask.Test1").GetInfo(), "Testing information task");
        }
Exemple #12
0
        public void CanRegisterInformation()
        {
            var service = new InformationService();

            service.Load(ContentLoader.TestDllName);

            Assert.AreEqual(service.Lookup.Count, 1);
            Assert.IsNotNull(service.Lookup["InfoTask.Test1"]);
            Assert.IsNotNull(service.Create("InfoTask.Test1"));
            Assert.AreEqual(service.Create("InfoTask.Test1").GetInfo(), "Testing information task");
        }
        public UserDetailsModel GetLoginCheck(Int64 PhoneNumber, string Password)
        {
            UserDetailsEntity       EntityObj = new UserDetailsEntity();
            UserDetailsModel        ModelObj  = new UserDetailsModel();
            InformationObjectMapper ObjMapper = new InformationObjectMapper();

            ServiceLayer.InformationService obj = new InformationService();
            EntityObj = obj.GetLoginCheck(PhoneNumber, Password);
            ModelObj  = ObjMapper.MapUserDetailsModelToEntity(EntityObj);
            return(ModelObj);
        }
 public MatterixPlus(ApplicationDbContext context, UserManager <ApplicationUser> userManager, FilesService file, InformationService info, CourseService course, AccessService access, PdfService pdf, EmailService email)
 {
     _context     = context;
     _userManager = userManager;
     _file        = file;
     _info        = info;
     _course      = course;
     _access      = access;
     _pdf         = pdf;
     _email       = email;
 }
Exemple #15
0
        public void InformationService_WhenIdDoesNotExists_ResultIsFalse()
        {
            //Arrange
            var service = new InformationService();

            //Act
            var result = service.RequestInfomation(new FakeDataReader());

            //Assert
            Assert.IsFalse(result);
        }
        public List <GDictionaryModel> FetchReviews()
        {
            List <GDictionary>      gdEntityList = new List <GDictionary>();
            List <GDictionaryModel> gdModel      = new List <GDictionaryModel>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            gdEntityList = obj.FetchReviews();
            gdModel      = objmapper.MapGDictionaryEntityListToModelList(gdEntityList);
            return(gdModel);
        }
        public UserDetailsModel AdminLoginCheck(Int64 PhoneNumber, string Password)
        {
            UserDetailsModel  UserModel  = new UserDetailsModel();
            UserDetailsEntity UserEntity = new UserDetailsEntity();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            UserEntity = obj.AdminLoginCheck(PhoneNumber, Password);
            UserModel  = objmapper.MapUserDetailsModelToEntity(UserEntity);
            return(UserModel);
        }
        public List <UserDetailsModel> FetchUserDetailsForAdminPage(Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <UserDetailsModel>  listObj       = new List <UserDetailsModel>();
            List <UserDetailsEntity> EntityListObj = new List <UserDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            EntityListObj = obj.FetchUserDetailsForAdminPage(PAGENUMBER, out TotalPageNumber);
            listObj       = objmapper.MapUserDetailsModelListToEntityList(EntityListObj);
            return(listObj);
        }
        public List <AdViewStatisticsModel> FetchAdViewsStatistics(Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <AdViewStatisticsModel>   listObj       = new List <AdViewStatisticsModel>();
            List <AdViewsStatisticsEntity> EntityListObj = new List <AdViewsStatisticsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            EntityListObj = obj.FetchAdViewsStatistics(PAGENUMBER, out TotalPageNumber);
            listObj       = objmapper.MapAdViewsStatisticsEntityListToAdViewStatisticsModelList(EntityListObj);
            return(listObj);
        }
 public HomeController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, CourseService courseService, ApplicationDbContext context, PaymentService paymentService, IHostingEnvironment environment, InformationService information, EmailService email, PdfService pdf)
 {
     _userManager    = userManager;
     _signInManager  = signInManager;
     _courseService  = courseService;
     _context        = context;
     _paymentService = paymentService;
     _environment    = environment;
     _information    = information;
     _email          = email;
     _pdf            = pdf;
 }
        public UserDetailsModel GetUserDetailsWithOTP(Int32 OTP, Int64 PhoneNumber)
        {
            UserDetailsModel  DetModelObj  = new UserDetailsModel();
            UserDetailsEntity DetEntityObj = new UserDetailsEntity();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            DetEntityObj = obj.GetUserDetailsWithOTP(OTP, PhoneNumber);
            DetModelObj  = ObjMapper.MapDetailsEntityToDetailsModel(DetEntityObj);
            return(DetModelObj);
        }
        public List <ExceptionModel> FetchExceptionsForAdmin()
        {
            List <ExceptionModel>  ModelList  = new List <ExceptionModel>();
            List <ExceptionEntity> EntityList = new List <ExceptionEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            EntityList = obj.FetchExceptionDetailsForAdmin();
            ModelList  = ObjMapper.MapExceptionEntityToModel(EntityList);
            return(ModelList);
        }
        public List <ContactUsModel> FetchContactForAdmin()
        {
            List <ContactUsModel>  ModelList  = new List <ContactUsModel>();
            List <ContactUsEntity> EntityList = new List <ContactUsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            EntityList = obj.FetchContactUsDetailsForAdmin();
            ModelList  = ObjMapper.MapContactUsEntityToModel(EntityList);
            return(ModelList);
        }
        public List <AdDetailsModel> FetchAdsForHomePage(Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <AdDetailsModel>  listObj       = new List <AdDetailsModel>();
            List <AdDetailsEntity> EntityListObj = new List <AdDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            EntityListObj = obj.FetchAdsForHomePage(PAGENUMBER, out TotalPageNumber);
            listObj       = ObjMapper.MapAdDetailsListEntityToAdDetailsModel(EntityListObj);
            return(listObj);
        }
        public AdDetailsModel SPRRGetAdDisplayDetails(Int32 AdId)
        {
            AdDetailsModel  Model  = new AdDetailsModel();
            AdDetailsEntity Entity = new AdDetailsEntity();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            Entity = obj.SPRRGetAdDisplayDetails(AdId);
            Model  = ObjMapper.MapAdDetailsEntityToAdDetailsModel(Entity);
            return(Model);
        }
        public List <AdDetailsModel> SPRRGetADbyCategory(int CategoryID, Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <AdDetailsModel>  listObj       = new List <AdDetailsModel>();
            List <AdDetailsEntity> EntityListObj = new List <AdDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            EntityListObj = obj.SPRRGetADbyCategory(CategoryID, PAGENUMBER, out TotalPageNumber);
            listObj       = ObjMapper.MapAdDetailsListEntityToAdDetailsModel(EntityListObj);
            return(listObj);
        }
        public UserDetailsModel GetUserDetailsWithPassword(Int64 PhoneNumber, string Password)
        {
            UserDetailsModel  DetModelObj  = new UserDetailsModel();
            UserDetailsEntity DetEntityObj = new UserDetailsEntity();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            DetEntityObj = obj.GetUserDetailsWithPassword(PhoneNumber, Password);
            DetModelObj  = ObjMapper.MapDetailsEntityToDetailsModel(DetEntityObj);
            return(DetModelObj);
        }
        public List <AdDetailsModel> GetUserAds(Int64 PhoneNumber, string Password, int INTPAGENUMBER, out int TotalPageNumber)
        {
            List <AdDetailsModel>  listobj    = new List <AdDetailsModel>();
            List <AdDetailsEntity> listEntity = new List <AdDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            listEntity = obj.GetUserAds(PhoneNumber, Password, INTPAGENUMBER, out TotalPageNumber);
            listobj    = ObjMapper.MapAdDetailsEntityListToAdDetailsModel(listEntity);
            return(listobj);
        }
        public List <AdDetailsModel> FetAdDetailsForAdminPageVerifiedAds(Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <AdDetailsModel>  listObj       = new List <AdDetailsModel>();
            List <AdDetailsEntity> EntityListObj = new List <AdDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            EntityListObj = obj.FetAdDetailsForAdminPageVerifiedAds(PAGENUMBER, out TotalPageNumber);
            listObj       = objmapper.MapAdDetailsListEntityToAdDetailsModel(EntityListObj);
            return(listObj);
        }
        public List <UserDetailsModel> FetchUnverifiedUsers(Int32 PAGENUMBER, out int TotalPageNumber)
        {
            List <UserDetailsModel>  ModelList  = new List <UserDetailsModel>();
            List <UserDetailsEntity> EntityList = new List <UserDetailsEntity>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            EntityList = obj.FetchUnverifiedUsers(PAGENUMBER, out TotalPageNumber);
            ModelList  = ObjMapper.MapUserDetailsModelListToEntityList(EntityList);
            return(ModelList);
        }
        public List <GDictionaryModel> FetMandalsOfDistrct(int DistrictId)
        {
            List <GDictionary>      gdEntityList = new List <GDictionary>();
            List <GDictionaryModel> gdModel      = new List <GDictionaryModel>();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         objmapper = new InformationObjectMapper();

            gdEntityList = obj.FetMandalsOfDistrct(DistrictId);
            gdModel      = objmapper.MapGDictionaryEntityListToModelList(gdEntityList);
            return(gdModel);
        }