Exemple #1
0
        public UnitOfWork(KaznituLabContext context)
        {
            db           = context;
            Users        = new UserRepository(db);
            Equipments   = new EquipmentRepository(db);
            Laboratories = new LaboratoryRepository(db);
            Project      = new ProjectRepository(db);
            Works        = new WorkRepository(db);

            //

            EquipmentTechnicalMaintenances = new Repository <EquipmentTechnicalMaintenance>(db);
            LaboratoryEmployees            = new Repository <LaboratoryEmployee>(db);
            LaboratoryEqiupments           = new Repository <LaboratoryEqiupment>(db);
            LaboratoryServices             = new Repository <LaboratoryService>(db);
            LaboratoryProjects             = new Repository <LaboratoryProject>(db);
            ProjectContracts = new Repository <ProjectContract>(db);
            ProjectCustomers = new Repository <ProjectCustomer>(db);
            ProjectEmployees = new Repository <ProjectEmployee>(db);
            WorkCoAuthors    = new Repository <WorkCoAuthor>(db);
            ProjectCertificateRegistrations = new Repository <ProjectCertificateRegistration>(db);
            ProjectFundings            = new Repository <ProjectFunding>(db);
            ProjectFundingStages       = new Repository <ProjectFundingStage>(db);
            ProjectFundingCoFinancings = new Repository <ProjectFundingCoFinancing>(db);
            ProjectPatents             = new Repository <ProjectPatent>(db);
            ProjectRevenues            = new Repository <ProjectRevenue>(db);
        }
        public void Repository_Can_Add_Entity()
        {
            var labRepo = new LaboratoryRepository();
            var expectedName = "Test Lab";
            var lab = new Laboratory(expectedName);

            labRepo.Add(lab);

            var insertedLab = labRepo.GetAll().First();
            Assert.IsNotNull(insertedLab);
            Assert.AreEqual(expectedName, insertedLab.Name);
        }