public void GetClientListWithFilters()
        {
            var data        = ClientsDataForTest.GetTestClientsWithPurchases().ToList();
            var mockContext = new Mock <SalesReportContext>();

            mockContext.Setup(c => c.Clients).Returns(DbContextMock.GetQueryableMockDbSet(data));
            var repository = new ClientRepository(mockContext.Object);
            var result     = repository.GetClientListWithFilters(null, null, null).ToList();

            Assert.Equal(4, result.Count);
            Assert.NotNull(result);
            result = repository.GetClientListWithFilters(dateTimeFrom, dateTimeTo, null).ToList();
            Assert.Equal(2, result.Count);
            Assert.NotNull(result);
            result = repository.GetClientListWithFilters(null, null, clientName).ToList();
            Assert.Single(( IEnumerable )result);
            Assert.NotNull(result);
            result = repository.GetClientListWithFilters(dateTimeFrom, dateTimeTo, clientName).ToList();
            Assert.Single(( IEnumerable )result);
            Assert.NotNull(result);
        }
        public void SetUp()
        {
            properties = new List <Property>
            {
                new Property {
                    Id      = 1,
                    Address = "Drujba, 6",
                    Area    = 100,
                    Rooms   = 7,
                    Beds    = 3,
                    Rent    = 150
                }
            };

            dbContext = new Mock <RmsContext>();

            dbContext.Setup(p => p.Properties)
            .Returns(DbContextMock.GetQueryableMockDbSet(properties));

            propertyService = new PropertyService(dbContext.Object);
        }
Exemplo n.º 3
0
        public void GetQuantityRequestPracticioner()
        {
            List <RequestProject> requestProject = new List <RequestProject>
            {
                new RequestProject
                {
                    IdRequestProject = 3,
                    RequestDate      = DateTime.Now,
                    IdProject        = 2,
                    Enrollment       = "zS18012123",
                    RequestStatus    = RequestStatus.REQUESTED
                }
            };
            DbSet <RequestProject>       mockSet     = DbContextMock.GetQueryableMockDbSet(requestProject, x => x.IdRequestProject);
            ProfessionalPracticesContext mockContext = DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = new UnitOfWork(mockContext);

            RequestProject requestProjectsFound = unitOfWork.RequestProjects.FindFirstOccurence(Request => Request.Enrollment == "zS18012123");

            Assert.IsNotNull(requestProjectsFound.Enrollment);
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            tenants    = new List <Tenant>();
            properties = new List <Property>();
            payments   = new List <Payment>();

            dbContext = new Mock <RmsContext>();

            dbContext.Setup(p => p.Tenants)
            .Returns(DbContextMock.GetQueryableMockDbSet(tenants));

            dbContext.Setup(p => p.Properties)
            .Returns(DbContextMock.GetQueryableMockDbSet(properties));

            dbContext.Setup(p => p.Payments)
            .Returns(DbContextMock.GetQueryableMockDbSet(payments));

            paymentService  = new PaymentService(dbContext.Object);
            propertyService = new PropertyService(dbContext.Object);
            tenantService   = new TenantService(dbContext.Object, propertyService, paymentService);
        }
Exemplo n.º 5
0
        public void TestInitialize()
        {
            _monthlyReports = new List <MonthlyReport>
            {
                new MonthlyReport
                {
                    IdMonthlyReport     = 2,
                    DeliveryDate        = DateTime.Now,
                    PerformedActivities = "Acordar con la organización vinculada las tareas que se realizarán",
                    ResultsObtained     = "Documento de calendario de actividades",
                    HoursReported       = 20,
                    HoursCumulative     = 20,
                    Enrollment          = "zS18012124",
                    IdProject           = 1
                }
            };

            _mockSet     = DbContextMock.GetQueryableMockDbSet(_monthlyReports, p => p.IdMonthlyReport);
            _mockContext = DbContextMock.GetContext(_mockSet);
            _unitOfWork  = DbContextMock.GetUnitOfWork(_mockContext);
        }
Exemplo n.º 6
0
        public void RegisterProject_Exists()
        {
            List <Project>  projects = new List <Project>();
            DbSet <Project> mockSet  = DbContextMock.GetQueryableMockDbSet(projects, p => p.NameProject);
            ProfessionalPracticesContext mockContext = DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = DbContextMock.GetUnitOfWork(mockContext);
            Project    newProject = new Project
            {
                NameProject        = "Sistema Integral Académico",
                Description        = "Desarrollar un Sistema Web que gestione los procesos académicos que realizan las diferentes áreas dentro de la Universidad Veracruzana dentro de un mismo portal.",
                ObjectiveGeneral   = "Optimizar los procesos de consulta y seguimiento de los académicos.",
                ObjectiveImmediate = "Revisión, análisis y documentación de requerimientos académicos con las áreas involucradas durante este desarrollo. " +
                                     "Revisión y análisis de la arquitectura." +
                                     "Desarrollo de prototipo.",
                ObjectiveMediate = "Modificación de documentación y Modificación de prototipos.",
                Methodology      = "Proceso de desarrollo iterativo y Design Sprint, SCRUM",
                Resources        = "1 Ingeniero de software/programador Web " +
                                   "Recursos materiales: " +
                                   "Computadoras de escritorio " +
                                   "IDE para programación(Visual Studio con C#) " +
                                   "Acceso a Internet " +
                                   "Documentación de procesos",
                Activities       = "Realizar a cabo la documentación del desarrollo del proyecto de la primera fase del proyecto, mediante el modelado de casos de uso, la descripción de los mismos y modelo de dominio, desarrollar sobre lenguaje C# y servicios dentro de un API, además de trabajar en equipo dentro del departamento.",
                Responsibilities = "Cumplir con las funciones y actividades que sean asignadas " +
                                   "Cumplir en tiempo y forma con las entregas de prototipos y productos " +
                                   "Desarrollar en un ambiente colaborativo " +
                                   "Trabajar de acuerdo a los estándares establecidos",
                DaysHours              = "A acordar con el estudiante (en horario de oficina)",
                Duration               = 480,
                Term                   = "FEBRERO-JULIO 2021",
                QuantityPracticing     = 3,
                StaffNumberCoordinator = "1515151"
            };

            unitOfWork.Projects.Add(newProject);
            int expected = 1;
            int actual   = projects.Count;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 7
0
        public void DetermineIfActivityPracticionersExists_Exists()
        {
            string          dateConvert = "2021-04-04 12:14:11";
            IFormatProvider format      = new System.Globalization.CultureInfo("es-ES", false);
            DateTime        date        = new DateTime();

            date = DateTime.ParseExact(dateConvert, "yyyy-MM-dd HH:mm:ss", format);

            List <ActivityPracticioner> data = new List <ActivityPracticioner>
            {
                new ActivityPracticioner
                {
                    IdActivityPracticioner     = 9,
                    Qualification              = 0,
                    ActivityPracticionerStatus = ActivityPracticionerStatus.NOTQUALIFIED,
                    Enrollment = "zS18012149",
                    Activity   = new Activity
                    {
                        IdActivity         = 1,
                        Name               = "Primer reporte parcial",
                        ActivityType       = ActivityType.PartialReport,
                        ActivityStatus     = ActivityStatus.ACTIVE,
                        Description        = "Entregar el primer reporte parcial corresponsdiente a 200 horas.",
                        ValueActivity      = 10,
                        StartDate          = new DateTime(),
                        FinishDate         = date,
                        StaffNumberTeacher = "5678"
                    }
                }
            };
            DbSet <ActivityPracticioner> mockSet     = DbContextMock.GetQueryableMockDbSet(data, x => x.IdActivityPracticioner);
            ProfessionalPracticesContext mockContext = DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = new UnitOfWork(mockContext);

            IEnumerable <ActivityPracticioner> activityPracticioners = unitOfWork.ActivityPracticioners.Find(ActivityPracticioner => ActivityPracticioner.Enrollment.Equals("zS18012149") &&
                                                                                                             ActivityPracticioner.Activity.ActivityType == ActivityType.PartialReport && ActivityPracticioner.Activity.ActivityStatus == ActivityStatus.ACTIVE);

            Assert.IsNotNull(activityPracticioners);
        }
Exemplo n.º 8
0
        public void ValidGetPracticionerProject()
        {
            List <Assignment> assigment = new List <Assignment>
            {
                new Assignment
                {
                    IdAssignment         = 1,
                    CompletionTerm       = "FEBRERO-JUNIO 2021",
                    Status               = AssignmentStatus.Assigned,
                    IdOfficeOfAcceptance = 1,
                    IdProject            = 1,
                    Enrollment           = "zS18012124",
                    DateAssignment       = DateTime.Now
                }
            };
            DbSet <Assignment>           _mockSet     = DbContextMock.GetQueryableMockDbSet(assigment, a => a.IdAssignment);
            ProfessionalPracticesContext _mockContext = DbContextMock.GetContext(_mockSet);
            UnitOfWork unitOfWork = new UnitOfWork(_mockContext);
            IEnumerable <Assignment> assignment = unitOfWork.Assignments.Find(Assigment => Assigment.Enrollment == "zS18012124" && Assigment.IdProject == 1);

            Assert.IsNotNull(assignment);
        }
Exemplo n.º 9
0
        public void TestInitialize()
        {
            _data = new List <LinkedOrganization>
            {
                new LinkedOrganization
                {
                    Name                     = "Dirección de Desarrollo Informático de Apoyo Académico",
                    DirectUsers              = "Comunidad Academica",
                    IndirectUsers            = "Comunidad universitaria y población en general",
                    Email                    = "*****@*****.**",
                    IdCity                   = 1,
                    IdSector                 = 1,
                    IdState                  = 1,
                    Address                  = "Circuito Aguirre Beltrán S/N",
                    LinkedOrganizationStatus = LinkedOrganizationStatus.ACTIVE
                }
            };
            DbSet <LinkedOrganization>   _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.Email);
            ProfessionalPracticesContext _mockContext = DbContextMock.GetContext(_mockSet);

            _unitOfWork = new UnitOfWork(_mockContext);
        }
Exemplo n.º 10
0
        public void CoordinatorRegisteredTest()
        {
            List <Coordinator>           coordinators = new List <Coordinator>();
            DbSet <Coordinator>          mockSet      = DbContextMock.GetQueryableMockDbSet(coordinators, c => c.StaffNumber);
            ProfessionalPracticesContext mockContext  =
                DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = DbContextMock.GetUnitOfWork(mockContext);

            Coordinator newlyCreatedCoordinator = new Coordinator
            {
                StaffNumber      = "XGC16215",
                RegistrationDate = DateTime.Now,
                DischargeDate    = null,
                User             = new User
                {
                    IdUser         = 1,
                    Name           = "Eduardo Aldair",
                    LastName       = "Hernández Solís",
                    Gender         = Gender.MALE,
                    UserStatus     = UserStatus.ACTIVE,
                    Email          = "*****@*****.**",
                    AlternateEmail = "*****@*****.**",
                    PhoneNumber    = "2298046218",
                    Account        = new Account
                    {
                        Username   = "******",
                        Password   = "******",
                        FirstLogin = true
                    }
                }
            };

            unitOfWork.Coordinators.Add(newlyCreatedCoordinator);

            int expected = 1;
            int actual   = coordinators.Count;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 11
0
 public void TestInitialize()
 {
     _data = new List <User>
     {
         new User
         {
             IdUser         = 1,
             Name           = "Eduardo Aldair",
             LastName       = "Hernández Solís",
             Gender         = Gender.MALE,
             UserStatus     = UserStatus.ACTIVE,
             Email          = "*****@*****.**",
             AlternateEmail = "*****@*****.**",
             PhoneNumber    = "2298046218",
             UserType       = UserType.Coordinator
         }
     };
     _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.IdUser);
     _mockContext = DbContextMock.GetContext(_mockSet);
     _repository  = new Repository <User>(_mockContext);
     _unitOfWork  = new UnitOfWork(_mockContext);
 }
Exemplo n.º 12
0
        public void TestInitialize()
        {
            DateTime localDate = DateTime.Now;

            _data = new List <PartialReport>
            {
                new PartialReport
                {
                    NumberReport    = "PRIMERO",
                    ResultsObtained = "Actividades completas",
                    HoursCovered    = 240,
                    Observations    = "Falto una actividad",
                    DeliveryDate    = localDate,
                    IdProject       = 1,
                    Enrollment      = "zS18012149"
                }
            };
            DbSet <PartialReport>        _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.IdParcialReport);
            ProfessionalPracticesContext _mockContext = DbContextMock.GetContext(_mockSet);

            _unitOfWork = new UnitOfWork(_mockContext);
        }
Exemplo n.º 13
0
        public void SoftDeleteTeacher_Exists()
        {
            List <Teacher>  teachers = new List <Teacher>();
            DbSet <Teacher> mockSet  = DbContextMock.GetQueryableMockDbSet(teachers, t => t.StaffNumber);
            ProfessionalPracticesContext mockContext = DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = DbContextMock.GetUnitOfWork(mockContext);
            Teacher    newTeacher = new Teacher
            {
                StaffNumber = "124987",
                User        = new User
                {
                    Name           = "Jorge Octavio",
                    LastName       = "Ocharan Hernandez",
                    Gender         = Gender.MALE,
                    UserStatus     = UserStatus.ACTIVE,
                    PhoneNumber    = "2284564791",
                    UserType       = UserType.Teacher,
                    Email          = "*****@*****.**",
                    AlternateEmail = "*****@*****.**",
                    Account        = new Account
                    {
                        Username   = "******",
                        Password   = "******",
                        FirstLogin = true
                    }
                }
            };

            teachers.Add(newTeacher);
            Teacher deleteTeacher = unitOfWork.Teachers.Get(newTeacher.StaffNumber);

            deleteTeacher.User.UserStatus = UserStatus.ACTIVE;
            teachers.Remove(newTeacher);
            int expected = 0;
            int actual   = teachers.Count;

            Assert.AreEqual(expected, actual);
        }
        public void Test28032021()
        {
            Currency currency = new Currency
            {
                Id   = 1,
                Name = "CAD"
            };
            List <Currency> currencies = new List <Currency> {
                currency
            };
            List <CurrencyRateHistory> entities = new List <CurrencyRateHistory>();

            entities.Add(new CurrencyRateHistory
            {
                Date       = new DateTime(2021, 03, 28),
                CurrencyId = 1,
                Id         = 99,
                Rate       = 88.00,
                Currency   = currency
            });

            var myDbMoq = new Mock <ApplicationDbContext>();

            myDbMoq.Setup(p => p.CurrencyRateHistory).Returns(
                DbContextMock.GetQueryableMockDbSet(entities));
            myDbMoq.Setup(p => p.Currencies).Returns(
                DbContextMock.GetQueryableMockDbSet(currencies));
            myDbMoq.Setup(p => p.SaveChanges()).Returns(2);
            ExchangeRatesService ers = new ExchangeRatesService(myDbMoq.Object);

            var ret = ers.PrepareRates(
                new ExchangeRateRequest {
                Date = new DateTime(2021, 03, 28)
            });

            Assert.True(ret.Exists(x => x.Rate == 88.00 & x.Name.Equals("CAD")));
        }
Exemplo n.º 15
0
        public void DetermineIfPracticionerExists_Exists()
        {
            List <Practicioner> data = new List <Practicioner>
            {
                new Practicioner
                {
                    Enrollment = "zS18012149",
                    Credits    = 300,
                    Group      = new Group
                    {
                        IdGroup = 1,
                        Nrc     = "12345"
                    },
                    IdUser = 1
                }
            };
            DbSet <Practicioner>         mockSet     = DbContextMock.GetQueryableMockDbSet(data, x => x.Enrollment);
            ProfessionalPracticesContext mockContext = DbContextMock.GetContext(mockSet);
            UnitOfWork unitOfWork = new UnitOfWork(mockContext);

            Practicioner practicioner = unitOfWork.Practicioners.FindFirstOccurence(Practicioner => Practicioner.Enrollment == "zS18012149");

            Assert.IsNotNull(practicioner);
        }
Exemplo n.º 16
0
 public void TestInitialize()
 {
     _data = new List <Phone>
     {
         new Phone
         {
             IdPhoneNumber        = 1,
             IdLinkedOrganization = 1,
             Extension            = "521",
             PhoneNumber          = "2281244285"
         },
         new Phone
         {
             IdPhoneNumber        = 2,
             IdLinkedOrganization = 1,
             Extension            = "521",
             PhoneNumber          = "2281172455"
         },
     };
     _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.IdPhoneNumber);
     _mockContext = DbContextMock.GetContext(_mockSet);
     _repository  = new PhoneRepository(_mockContext);
     _unitOfWork  = new UnitOfWork(_mockContext);
 }
Exemplo n.º 17
0
        public void RegisterPartialReport_Exists()
        {
            DateTime                     localDate        = DateTime.Now;
            List <PartialReport>         partialReports   = new List <PartialReport>();
            DbSet <PartialReport>        mockSet          = DbContextMock.GetQueryableMockDbSet(partialReports, p => p.IdParcialReport);
            ProfessionalPracticesContext mockContext      = DbContextMock.GetContext(mockSet);
            UnitOfWork                   unitOfWork       = DbContextMock.GetUnitOfWork(mockContext);
            PartialReport                newPartialReport = new PartialReport
            {
                NumberReport    = "PRIMERO",
                ResultsObtained = "Actividades completas",
                HoursCovered    = 240,
                Observations    = "Falto una actividad",
                DeliveryDate    = localDate,
                IdProject       = 1,
                Enrollment      = "zS18012149"
            };

            unitOfWork.PartialReports.Add(newPartialReport);
            int expected = 1;
            int actual   = partialReports.Count;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 18
0
        public void TestInitialize()
        {
            _groupValidator = new GroupValidator();
            _practicioners  = new List <Practicioner> {
                new Practicioner
                {
                    Enrollment = "zS18012124",
                    Term       = "FEBRERO - JULIO 2021",
                    Credits    = 288,
                    User       = new User
                    {
                        IdUser         = 1,
                        Name           = "Pedro",
                        LastName       = "Lopez",
                        Gender         = Gender.MALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456785",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                },

                new Practicioner
                {
                    Enrollment = "zS18012125",
                    Term       = "FEBRERO - JULIO 2021",
                    Credits    = 288,
                    User       = new User
                    {
                        IdUser         = 2,
                        Name           = "Priscila",
                        LastName       = "Luna",
                        Gender         = Gender.FEMALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456784",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                },

                new Practicioner
                {
                    Enrollment = "zS18012126",
                    Term       = "FEBRERO - JULIO 2021",
                    Credits    = 288,
                    User       = new User
                    {
                        IdUser         = 3,
                        Name           = "Pablo",
                        LastName       = "Lara",
                        Gender         = Gender.MALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456783",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                },

                new Practicioner
                {
                    Enrollment = "zS18012127",
                    Term       = "FEBRERO - JULIO 2021",
                    Credits    = 288,
                    User       = new User
                    {
                        IdUser         = 4,
                        Name           = "Patricio",
                        LastName       = "Lourdes",
                        Gender         = Gender.MALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456782",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                },

                new Practicioner
                {
                    Enrollment = "zS18012128",
                    Term       = "FEBRERO - JULIO 2021",
                    Credits    = 288,
                    User       = new User
                    {
                        IdUser         = 5,
                        Name           = "Patricia",
                        LastName       = "Lozcano",
                        Gender         = Gender.FEMALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456781",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                }
            };

            _teacher = new List <Teacher>
            {
                new Teacher
                {
                    StaffNumber      = "65245",
                    RegistrationDate = DateTime.Now,
                    DischargeDate    = null,
                    User             = new User
                    {
                        IdUser         = 6,
                        Name           = "Tamara",
                        LastName       = "Lopez",
                        Gender         = Gender.FEMALE,
                        UserStatus     = UserStatus.ACTIVE,
                        Email          = "*****@*****.**",
                        AlternateEmail = "*****@*****.**",
                        PhoneNumber    = "2281456789",
                        Account        = new Account
                        {
                            Username   = "******",
                            Password   = "******",
                            FirstLogin = true
                        }
                    }
                }
            };

            _group = new List <Group>
            {
                new Group
                {
                    IdGroup     = 1,
                    Nrc         = "12341",
                    GroupStatus = GroupStatus.ACTIVE,
                    Term        = "FEBRERO-JUNIO 2021",
                    StaffNumber = "65245"
                }
            };

            _mockSetPracticioner = DbContextMock.GetQueryableMockDbSet(_practicioners, p => p.Enrollment);
            _mockContext         = DbContextMock.GetContext(_mockSetPracticioner);
            _mockSetTeacher      = DbContextMock.GetQueryableMockDbSet(_teacher, t => t.StaffNumber);
            _mockContext         = DbContextMock.GetContext(_mockSetTeacher);
            _mockSetGroup        = DbContextMock.GetQueryableMockDbSet(_group, g => g.IdGroup);
            _mockContext         = DbContextMock.GetContext(_mockSetGroup);

            _unitOfWork = DbContextMock.GetUnitOfWork(_mockContext);
        }
Exemplo n.º 19
0
        public void TestInitialize()
        {
            string          dateConvert = "2021-04-04 12:14:11";
            IFormatProvider format      = new System.Globalization.CultureInfo("es-ES", false);
            DateTime        date        = new DateTime();

            date = DateTime.ParseExact(dateConvert, "yyyy-MM-dd HH:mm:ss", format);

            _data = new List <ActivityPracticioner>
            {
                new ActivityPracticioner
                {
                    IdActivityPracticioner     = 9,
                    Qualification              = 0,
                    ActivityPracticionerStatus = ActivityPracticionerStatus.NOTQUALIFIED,
                    Enrollment = "zS18012149",
                    Activity   = new Activity
                    {
                        IdActivity         = 1,
                        Name               = "Primer reporte parcial",
                        ActivityType       = ActivityType.PartialReport,
                        ActivityStatus     = ActivityStatus.ACTIVE,
                        Description        = "Entregar el primer reporte parcial corresponsdiente a 200 horas.",
                        ValueActivity      = 10,
                        StartDate          = new DateTime(),
                        FinishDate         = date,
                        StaffNumberTeacher = "5678"
                    }
                }
            };
            DbSet <ActivityPracticioner> _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.IdActivityPracticioner);
            ProfessionalPracticesContext _mockContext = DbContextMock.GetContext(_mockSet);

            _unitOfWork = new UnitOfWork(_mockContext);

            _dataActivity = new List <Activity> {
                new Activity
                {
                    IdActivity         = 1,
                    Name               = "Primer reporte parcial",
                    ActivityType       = ActivityType.PartialReport,
                    ActivityStatus     = ActivityStatus.ACTIVE,
                    Description        = "Entregar el primer reporte parcial corresponsdiente a 200 horas.",
                    ValueActivity      = 10,
                    StartDate          = new DateTime(),
                    FinishDate         = date,
                    StaffNumberTeacher = "5678"
                }
            };
            DbSet <Activity>             _mockSetActivity     = DbContextMock.GetQueryableMockDbSet(_dataActivity, x => x.IdActivity);
            ProfessionalPracticesContext _mockContextActivity = DbContextMock.GetContext(_mockSetActivity);

            _unitOfWorkActivity = new UnitOfWork(_mockContextActivity);

            _dataDocument = new List <Document> {
                new Document
                {
                    IdDocument           = 1,
                    Name                 = "datos.docx",
                    RouteSave            = "C:/Users/MARTHA/Documents/Activity/1",
                    DeliveryDate         = date,
                    ActivityPracticioner = new ActivityPracticioner
                    {
                        IdActivityPracticioner     = 9,
                        Qualification              = 0,
                        ActivityPracticionerStatus = ActivityPracticionerStatus.NOTQUALIFIED,
                        Enrollment = "zS18012149",
                        IdActivity = 1,
                        Activity   = new Activity
                        {
                            IdActivity         = 1,
                            Name               = "Primer reporte parcial",
                            ActivityType       = ActivityType.PartialReport,
                            ActivityStatus     = ActivityStatus.ACTIVE,
                            Description        = "Entregar el primer reporte parcial corresponsdiente a 200 horas.",
                            ValueActivity      = 10,
                            StartDate          = new DateTime(),
                            FinishDate         = date,
                            StaffNumberTeacher = "5678"
                        }
                    }
                }
            };
            DbSet <Document>             _mockSetDocument     = DbContextMock.GetQueryableMockDbSet(_dataDocument, x => x.IdDocument);
            ProfessionalPracticesContext _mockContextDocument = DbContextMock.GetContext(_mockSetDocument);

            _unitOfWorkDocument = new UnitOfWork(_mockContextDocument);
        }
Exemplo n.º 20
0
        public void TestInitialize()
        {
            _data = new List <LinkedOrganization>
            {
                new LinkedOrganization
                {
                    IdLinkedOrganization = 1,
                    Name          = "Intel",
                    DirectUsers   = "Comunidad estudiantil",
                    IndirectUsers = "Comunidad tecnológica",
                    Email         = "*****@*****.**",
                    PhoneNumbers  = new List <Phone>
                    {
                        new Phone
                        {
                            IdPhoneNumber        = 1,
                            IdLinkedOrganization = 1,
                            Extension            = "521",
                            PhoneNumber          = "2281244285"
                        },
                        new Phone
                        {
                            IdPhoneNumber        = 1,
                            IdLinkedOrganization = 1,
                            Extension            = "521",
                            PhoneNumber          = "2281115489"
                        },
                    },
                    Address  = "Enrique Segoviano",
                    IdCity   = 1,
                    IdState  = 1,
                    IdSector = 1,
                    LinkedOrganizationStatus = LinkedOrganizationStatus.ACTIVE,
                },
                new LinkedOrganization
                {
                    IdLinkedOrganization = 2,
                    Name          = "Sony",
                    DirectUsers   = "Comunidad estudiantil",
                    IndirectUsers = "Comunidad tecnológica",
                    Email         = "*****@*****.**",
                    PhoneNumbers  = new List <Phone>
                    {
                        new Phone
                        {
                            IdPhoneNumber        = 1,
                            IdLinkedOrganization = 1,
                            Extension            = "521",
                            PhoneNumber          = "2281244290"
                        },
                        new Phone
                        {
                            IdPhoneNumber        = 1,
                            IdLinkedOrganization = 1,
                            Extension            = "521",
                            PhoneNumber          = "2281240021"
                        },
                    },
                    Address  = "Obrero Campesino",
                    IdCity   = 1,
                    IdState  = 1,
                    IdSector = 1,
                    LinkedOrganizationStatus = LinkedOrganizationStatus.ACTIVE,
                }
            };

            _mockSet     = DbContextMock.GetQueryableMockDbSet(_data, x => x.IdLinkedOrganization);
            _mockContext = DbContextMock.GetContext(_mockSet);
            _repository  = new LinkedOrganizationRepository(_mockContext);
            _unitOfWork  = new UnitOfWork(_mockContext);
        }