public async Task GetCumulativeCsv_ValidInput_ReturnsByteArray()
        {
            // Arrange
            var service = new CsvService();

            var cumulativeData = new CumulativeData
            {
                Header = new CumulativeHeader {
                    MinOriginYear = 2000, DevelopmentYears = 5
                },
                CumulativeValues = new List <CumulativeValue>
                {
                    new CumulativeValue
                    {
                        Type   = ProductType.Comp,
                        Values = new List <double> {
                            1, 2, 3
                        }
                    }
                }
            };

            // Act
            var result = await service.GetCumulativeCsv(cumulativeData);

            // Assert
            Assert.NotNull(result);
            Assert.True(result.Length > 0);
        }
        public void GetCumulativeCsv_InvalidInput_ThrowsException()
        {
            // Arrange
            var service = new CsvService();

            // Act
            Task AsyncTest() => service.GetCumulativeCsv(null);

            // Assert
            var ex = Assert.ThrowsAsync <CsvException>(AsyncTest);

            Assert.AreEqual(CsvExceptionType.FailedToWrite, ex.Type);
        }