public void GivenNoResponseData_WhenConvertingToSheet_ArgumentExceptionIsThrown()
        {
            var converter = new GoogleSheetToSheetConverter();

            Action result = () => converter.Convert(null);

            result.Should().Throw <ArgumentException>();
        }
        public void GivenEmptyResponseData_WhenConvertingToSheet_NoCellsAreCreated()
        {
            var responseData = new GoogleSheetResponse();

            var converter = new GoogleSheetToSheetConverter();

            var result = converter.Convert(responseData);

            result.Rows.Should().BeEmpty();
        }
        public void GivenResponseDataContainsCell_WhenConvertingToSheet_CellShouldHaveCorrectRowNumber()
        {
            var responseData = new GoogleSheetDataResponseBuilder()
                               .WithRow(new List <string> {
                "myValue"
            })
                               .Build();

            var converter = new GoogleSheetToSheetConverter();

            var result = converter.Convert(responseData);

            result.Rows.Single().Cells.Should().NotBeEmpty();
            result.Rows.Single().Cells.Should().Contain(c => c.RowIndex == 0);
        }
        public void GivenResponseDataContainsRow_WhenConvertingToSheet_CellsInRowAreCreated()
        {
            var rowZeroColumnAValue = "row";
            var rowZeroColumnBValue = "0";
            var rowZeroColumnCValue = "text";

            var responseData = new GoogleSheetDataResponseBuilder()
                               .WithRow(new List <string> {
                rowZeroColumnAValue, rowZeroColumnBValue, rowZeroColumnCValue
            })
                               .Build();

            var converter = new GoogleSheetToSheetConverter();

            var result = converter.Convert(responseData);

            result.Rows.Should().NotBeEmpty();
            result.Rows.Single().Cells.Should().Contain(c => c.Value.ToString() == rowZeroColumnAValue);
            result.Rows.Single().Cells.Should().Contain(c => c.Value.ToString() == rowZeroColumnBValue);
            result.Rows.Single().Cells.Should().Contain(c => c.Value.ToString() == rowZeroColumnCValue);
        }