public void Trim()
        {
            var data = CSVLoader <Vector3> .LoadData(ref settings);

            settings.trimUp = 1;

            var trimmedData = CSVLoader <Vector3> .LoadData(ref settings);

            Assert.IsTrue(data.Skip(1).Count() == trimmedData.Count());
        }
        public void CSVLoaderReturnsNoNulls()
        {
            var data = CSVLoader <Vector3> .LoadData(ref settings);

            bool b = false;

            foreach (var sample in data)
            {
                foreach (var col in sample.values)
                {
                    if (col == null)
                    {
                        b = true;
                    }
                }
            }
            Assert.IsFalse(b);
        }
Exemple #3
0
        public void Setup()
        {
            // Setup loader.
            CSVLoaderSettings settings = new CSVLoaderSettings();

            settings.filePath = dataPath + "data.csv";
            settings.trimUp   = 1;
            settings.trimDown = 0;

            List <ICSVFilter> filters     = new List <ICSVFilter>(1);
            ICSVFilter        quaternions = new CSVEvenColumnFilter();

            filters.Add(quaternions);
            settings.filters = filters;

            var data = CSVLoader <Vector3> .LoadData(ref settings);

            // Initialize IntervalBased Transformer settings.
            intervalSettings = new IntervalBasedTransformerSettings
            {
                sampleList = data,
                interval   = 4
            };
            intervalTransformer = new IntervalBasedTransformer();

            // Initialize CountBased Transformer settings.
            countSettings = new IntervalBasedTransformerSettings
            {
                sampleList = data,
                count      = 10
            };
            countTransformer = new CountBasedTransformer();

            // Initialize Image Transformer.
            imageSettings = new ImageTransformerSettings
            {
                focusJoints = new LeapMotionJoint[] { LeapMotionJoint.PALM },
                samples     = data,
                size        = 10
            };
            imageTransformer = new ImageTransformer();
        }
        public void CSVLoaderFailWhenFileHasHeader()
        {
            settings.CSVHasHeader = false;

            Assert.Throws <System.FormatException>(() => { CSVLoader <Vector3> .LoadData(ref settings); });
        }
        public void CSVLoaderLoadsData()
        {
            var data = CSVLoader <Vector3> .LoadData(ref settings);

            Assert.IsTrue(data.Length > 0);
        }
        public void LoaderThrowsExceptionWhenNoFileGiven()
        {
            settings.filePath = "";

            Assert.Throws <System.IO.FileNotFoundException>(() => { CSVLoader <Vector3> .LoadData(ref settings); });
        }
Exemple #7
0
        static void Main(string[] args)
        {
            CSVLoader     loader  = new CSVLoader();
            WebDataLoader loader1 = new WebDataLoader("https://swabhav-tech.firebaseapp.com/emp.txt");

            loader1.LoadData();
            EmployeeDataAnalyzer analyzerweb = new EmployeeDataAnalyzer();

            EmployeeOBT employeeweb = (analyzerweb.MaxSalariedEmployee(loader1.GetParsedData()));

            Console.WriteLine("Employee ID = " + employeeweb.EmployeeID);
            Console.WriteLine("Employee Name = " + employeeweb.EmployeeName);
            Console.WriteLine("Employee Designation = " + employeeweb.Designation);
            Console.WriteLine("Manager ID = " + employeeweb.ManagerID);
            Console.WriteLine("Date of Joining = " + employeeweb.DateOfJoining);
            Console.WriteLine("Salary = " + employeeweb.Salary);
            Console.WriteLine("Commission = " + employeeweb.Commission);
            Console.WriteLine("Department Number = " + employeeweb.DepartmentNumber);

            Dictionary <string, int> designationWiseweb = analyzerweb.DesignationWiseCount(loader1.GetParsedData());

            foreach (KeyValuePair <string, int> emp in designationWiseweb)
            {
                Console.WriteLine(emp.Key + emp.Value);
            }

            Dictionary <string, int> departmentWiseweb = analyzerweb.DepartmentWiseCount(loader1.GetParsedData());

            foreach (KeyValuePair <string, int> emp in departmentWiseweb)
            {
                Console.WriteLine(emp.Key + emp.Value);
            }


            loader.LoadData();
            EmployeeDataAnalyzer analyzer = new EmployeeDataAnalyzer();

            EmployeeOBT employee = (analyzer.MaxSalariedEmployee(loader.GetParsedData()));

            Console.WriteLine("Employee ID = " + employee.EmployeeID);
            Console.WriteLine("Employee Name = " + employee.EmployeeName);
            Console.WriteLine("Employee Designation = " + employee.Designation);
            Console.WriteLine("Manager ID = " + employee.ManagerID);
            Console.WriteLine("Date of Joining = " + employee.DateOfJoining);
            Console.WriteLine("Salary = " + employee.Salary);
            Console.WriteLine("Commission = " + employee.Commission);
            Console.WriteLine("Department Number = " + employee.DepartmentNumber);

            Dictionary <string, int> designationWise = analyzer.DesignationWiseCount(loader.GetParsedData());

            foreach (KeyValuePair <string, int> emp in designationWise)
            {
                Console.WriteLine(emp.Key + emp.Value);
            }

            Dictionary <string, int> departmentWise = analyzer.DepartmentWiseCount(loader.GetParsedData());

            foreach (KeyValuePair <string, int> emp in departmentWise)
            {
                Console.WriteLine(emp.Key + emp.Value);
            }
        }