public void GivenGetDataWhenDescendingIsFalseByFirstNameThenNullReferenceException(string groupName, bool descending)
        {
            //Arrange
            PivotResultsReport pivotResultsReport = new PivotResultsReport(groupName, x => x.AverageExamValue, descending);

            //Assert
            Assert.That(() => pivotResultsReport.GetData(), Throws.TypeOf <NullReferenceException>());
        }
        public void GivenGetDataHeaderTest()
        {
            //Arrnge
            PivotResultsReport   pivotResultsReport    = new PivotResultsReport("PM-1", x => x.AverageExamValue, true);
            IEnumerable <string> expectedGetDataHeader = new List <string>
            {
                "NumberOfSession", "MaxExamValue", "MinExamValue", "AverageExamValue"
            };

            //Act
            var actualGetDataHeader = pivotResultsReport.GetDataHeader();

            //Assert
            Assert.AreEqual(expectedGetDataHeader, actualGetDataHeader);
        }
        public void GivenGetDataWhenDescendingIsFalseByAverageExamValue(string groupName, bool descending)
        {
            //Arrange
            PivotResultsReport pivotResultsReport = new PivotResultsReport(groupName, x => x.AverageExamValue, descending);
            IEnumerable <IEnumerable <string> > expectedGetData = new List <List <string> >()
            {
                new List <string> {
                    "1", "96", "1", "36,75"
                },
                new List <string> {
                    "2", "98", "4", "47,25"
                }
            };

            //Act
            IEnumerable <IEnumerable <string> > actualGetData = pivotResultsReport.GetData();

            //Assert
            Assert.AreEqual(expectedGetData, actualGetData);
        }
        public void GivenSaveToXLSXWhenDescendingIsFalseByAverageExamValue(string groupName, bool descending)
        {
            //Arrange
            var     location    = System.Reflection.Assembly.GetExecutingAssembly().Location;
            var     path        = Path.GetDirectoryName(location);
            IReport report      = new PivotResultsReport(groupName, x => x.AverageExamValue, descending);
            bool    fileIsExist = false;
            Excel   excel       = new Excel(path + "\\Excel\\", "PivotResultsReport");


            //Act
            excel.SaveToXLSX(report);

            if (File.Exists(path + "\\Excel\\" + "PivotResultsReport.xlsx"))
            {
                fileIsExist = true;
            }

            //Assert
            Assert.IsTrue(fileIsExist);
        }