Exemple #1
0
        public void SystemSpecsService_Employee_isEquivalent_return_true()
        {
            SystemSpecsService sss = new SystemSpecsService();

            FileData fd1, fd2;

            fd1 = Util.createData("testData1");
            fd2 = Util.createData("testData2");

            SystemSpecs ss1, ss2;

            ss1 = sss.AddSpecs(fd1);
            ss2 = sss.AddSpecs(fd2);

            ss1.POI[0] = 1;
            ss1.POI[1] = 2;

            ss2.POI[0] = 1;
            ss2.POI[1] = 2;

            List <SystemInfo> sysInfo = sss.GetSysInfo();

            Employee emp1, emp2;

            emp1 = sysInfo[0].Employees[0];
            emp2 = sysInfo[1].Employees[0];

            Assert.IsTrue(emp1.isEquivalent(emp2), "emp1.FullName: " + emp1.FullName + " emp2.FullName: " + emp2.FullName);
        }
Exemple #2
0
        public void SystemSpecsService_get_first_element_FirstLast_equal_false()
        {
            SystemSpecsService sss = new SystemSpecsService();
            FileData           fd  = Util.createData("testData");

            SystemSpecs ss = sss.AddSpecs(fd);

            Assert.AreEqual(sss.GetSpecs("testData").FirstLast, false);
        }
Exemple #3
0
        public void SystemSpecsService_addspecs_getSysInfo_get_employee_count_equal_2()
        {
            SystemSpecsService sss = new SystemSpecsService();
            FileData           fd  = Util.createData("testData");

            SystemSpecs ss = sss.AddSpecs(fd);

            Assert.AreEqual(sss.GetSysInfo()[0].Employees.Count, 2);
        }
Exemple #4
0
        public void ExportInfo_stuff()
        {
            FileData fd1, hr;

            hr  = Util.createData("HR");
            fd1 = Util.createData("testData1");

            List <string> t1 = new List <string>();

            t1.Add("User3");
            t1.Add("Last3");
            fd1.Add(t1);

            SystemSpecsService sss = new SystemSpecsService();
            SystemSpecs        hrSpecs, fd1Specs;

            hrSpecs  = sss.AddSpecs(hr);
            fd1Specs = sss.AddSpecs(fd1);

            hrSpecs.POI[0] = fd1Specs.POI[0] = 1;
            hrSpecs.POI[1] = fd1Specs.POI[1] = 2;


            List <SystemInfo> lsi = sss.GetSysInfo();

            var hrQuery = from si
                          in lsi
                          where si.Name == "HR"
                          select si;
            var sysQuery = from si
                           in lsi
                           where si.Name == "testData1"
                           select si;

            SystemInfo hrInfo  = hrQuery.ToList()[0];
            SystemInfo fd1Info = sysQuery.ToList()[0];

            ExportInfo exportInfo = new ExportInfo(fd1Info, hrInfo);
            string     testData   = exportInfo.MissingEmployees[0].FullName;

            Assert.IsTrue(testData == "User3Last3", "fullname: " + testData);
        }