public void TestInitialize() { testTypeReqEntity = new TypeReqEntity { Id = 1234, Name = "Taxi - Acoso", AdditionalFields = new List <AdditionalFieldEntity>() }; testAFEntity = new AdditionalFieldEntity { Id = 1234, Name = "MatrĂcula", Type = "TEXTO", Range = "Radio Taxi-Taxi aeropuerto-Fono Taxi", TypeReqEntityId = 1 }; typeReqRepository = new Mock <IRepository <TypeReqEntity> >(MockBehavior.Strict); topicRepository = new Mock <IRepository <TopicEntity> >(MockBehavior.Strict); aFRepository = new Mock <IRepository <AdditionalFieldEntity> >(MockBehavior.Strict); unitOfWork = new Mock <IUnitOfWork>(); unitOfWork.Setup(r => r.TypeReqRepository).Returns(typeReqRepository.Object); unitOfWork.Setup(r => r.TopicRepository).Returns(topicRepository.Object); unitOfWork.Setup(r => r.AdditionalFieldRepository).Returns(aFRepository.Object); typeReqLogic = new TypeReqLogic(unitOfWork.Object); }
public ImportLogic(IUnitOfWork unitOfWork, IConfiguration configuration, IAreaLogic areaLogic, ITopicLogic topicLogic, ITypeReqLogic typeLogic) { this.unitOfWork = unitOfWork; this.areaRepository = unitOfWork.AreaRepository; this.topicRepository = unitOfWork.TopicRepository; this.typeRepository = unitOfWork.TypeReqRepository; this.configuration = configuration; this.areaLogic = areaLogic; this.topicLogic = topicLogic; this.typeLogic = typeLogic; }
public void TestInitialize() { area = new AreaEntity { Id = 1, Name = "Limpieza", Topics = new List <TopicEntity>() }; topic = new TopicEntity { Id = 1, Name = "Contenedores de basura", AreaEntityId = 1, RequestTypes = new List <TypeReqEntity>() }; type = new TypeReqEntity { Id = 1, Name = "Roto", AdditionalFields = new List <AdditionalFieldEntity>(), TopicEntityId = 1 }; unitOfWork = new Mock <IUnitOfWork>(); areaRepository = new Mock <IRepository <AreaEntity> >(); topicRepository = new Mock <IRepository <TopicEntity> >(); typeRepository = new Mock <IRepository <TypeReqEntity> >(); unitOfWork.Setup(u => u.AreaRepository).Returns(areaRepository.Object); unitOfWork.Setup(u => u.TopicRepository).Returns(topicRepository.Object); unitOfWork.Setup(u => u.TypeReqRepository).Returns(typeRepository.Object); var configuration = new Mock <IConfiguration>(); configuration.Setup(c => c["DataImport:Path"]).Returns(".\\Assemblies\\DataImport"); areaLogic = new AreaLogic(unitOfWork.Object); topicLogic = new TopicLogic(unitOfWork.Object); typeLogic = new TypeReqLogic(unitOfWork.Object); importLogic = new ImportLogic(unitOfWork.Object, configuration.Object, areaLogic, topicLogic, typeLogic); }
public TypeReqController(ITypeReqLogic typeReqLogic, IWebApiMapper apiMapper) { this.mapper = apiMapper.Configure(); this.typeReqLogic = typeReqLogic; }