diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleAnalytics4DataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleAnalytics4DataSourceItemFixture.cs new file mode 100644 index 0000000..2c6620f --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleAnalytics4DataSourceItemFixture.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSourceItems +{ + public class GoogleAnalytics4DataSourceItemFixture + { + [Fact] + public void Constructor_SetsTitleAndDatasource_AsProvided() + { + // Arrange + var dataSource = new GoogleAnalytics4DataSource(); + var title = "Test title"; + + // Act + var dataSourceItem = new GoogleAnalytics4DataSourceItem(title, dataSource); + + // Assert + Assert.Equal(title, dataSourceItem.Title); + Assert.Equal(dataSource, dataSourceItem.DataSource); + } + + [Fact] + public void AccountId_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleAnalytics4DataSource(); + var dataSourceItem = new GoogleAnalytics4DataSourceItem("Test", dataSource); + var accountId = "TestAccountId"; + + // Act + dataSourceItem.AccountId = accountId; + + // Assert + Assert.Equal(accountId, dataSourceItem.AccountId); + Assert.Equal(accountId, dataSourceItem.Properties.GetValue("AccountId")); + } + + [Fact] + public void PropertyId_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleAnalytics4DataSource(); + var dataSourceItem = new GoogleAnalytics4DataSourceItem("Test", dataSource); + var propertyId = "TestPropertyId"; + + // Act + dataSourceItem.PropertyId = propertyId; + + // Assert + Assert.Equal(propertyId, dataSourceItem.PropertyId); + Assert.Equal(propertyId, dataSourceItem.Properties.GetValue("PropertyId")); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleBigQueryDataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleBigQueryDataSourceItemFixture.cs new file mode 100644 index 0000000..ea7e0b8 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleBigQueryDataSourceItemFixture.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSourceItems +{ + public class GoogleBigQueryDataSourceItemFixture + { + [Fact] + public void Constructor_SetsTitleAndDatasource_AsProvided() + { + // Arrange + var dataSource = new GoogleBigQueryDataSource(); + var title = "Test title"; + + // Act + var dataSourceItem = new GoogleBigQueryDataSourceItem(title, dataSource); + + // Assert + Assert.Equal(title, dataSourceItem.Title); + Assert.Equal(dataSource, dataSourceItem.DataSource); + } + + [Fact] + public void DataSetId_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleBigQueryDataSource(); + var dataSourceItem = new GoogleBigQueryDataSourceItem("Test", dataSource); + var datasetId = "DatasetId"; + + // Act + dataSourceItem.DataSetId = datasetId; + + // Assert + Assert.Equal(datasetId, dataSourceItem.DataSetId); + Assert.Equal(datasetId, dataSourceItem.Properties.GetValue("DataSetId")); + } + + [Fact] + public void PropertyId_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleBigQueryDataSource(); + var dataSourceItem = new GoogleBigQueryDataSourceItem("Test", dataSource); + var projectId = "TestPropertyId"; + + // Act + dataSourceItem.ProjectId = projectId; + + // Assert + Assert.Equal(projectId, dataSourceItem.ProjectId); + Assert.Equal(projectId, dataSourceItem.Properties.GetValue("ProjectId")); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleDriveDataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleDriveDataSourceItemFixture.cs new file mode 100644 index 0000000..1e0d645 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleDriveDataSourceItemFixture.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSourceItems +{ + public class GoogleDriveDataSourceItemFixture + { + [Fact] + public void Constructor_SetsTitleAndDatasource_AsProvided() + { + // Arrange + var dataSource = new GoogleDriveDataSource(); + var title = "Test title"; + + // Act + var dataSourceItem = new GoogleDriveDataSourceItem(title, dataSource); + + // Assert + Assert.Equal(title, dataSourceItem.Title); + Assert.Equal(dataSource, dataSourceItem.DataSource); + } + + [Fact] + public void Identitifer_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleDriveDataSource(); + var dataSourceItem = new GoogleDriveDataSourceItem("Test", dataSource); + var identifier = "IdentitiferTest"; + + // Act + dataSourceItem.Identitifer = identifier; + + // Assert + Assert.Equal(identifier, dataSourceItem.Identitifer); + Assert.Equal(identifier, dataSourceItem.Properties.GetValue("Identitifer")); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleSheetsDataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleSheetsDataSourceItemFixture.cs new file mode 100644 index 0000000..403e3d4 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/GoogleSheetsDataSourceItemFixture.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSourceItems +{ + public class GoogleSheetsDataSourceItemFixture + { + [Fact] + public void Constructor_SetsTitleAndDatasource_AsProvided() + { + // Arrange + var dataSource = new GoogleSheetsDataSource(); + var title = "Test title"; + + // Act + var dataSourceItem = new GoogleSheetsDataSourceItem(title, dataSource); + + // Assert + Assert.Equal(title, dataSourceItem.Title); + Assert.Equal(dataSource, dataSourceItem.DataSource); + } + + [Fact] + public void FirstRowContainsLabels_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleSheetsDataSource(); + var dataSourceItem = new GoogleSheetsDataSourceItem("Test", dataSource); + + // Act 1 + dataSourceItem.FirstRowContainsLabels = true; + + // Assert + Assert.True(dataSourceItem.FirstRowContainsLabels); + Assert.True(dataSourceItem.Properties.GetValue("FirstRowContainsLabels")); + + // Act 1 + dataSourceItem.FirstRowContainsLabels = false; + + // Assert + Assert.False(dataSourceItem.FirstRowContainsLabels); + Assert.False(dataSourceItem.Properties.GetValue("FirstRowContainsLabels")); + } + + [Fact] + public void NamedRange_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleSheetsDataSource(); + var dataSourceItem = new GoogleSheetsDataSourceItem("Test", dataSource); + var namedRange = "NamedRangeTest"; + + // Act + dataSourceItem.NamedRange = namedRange; + + // Assert + Assert.Equal(namedRange, dataSourceItem.NamedRange); + Assert.Equal(namedRange, dataSourceItem.Properties.GetValue("NamedRange")); + } + + [Fact] + public void PivotTable_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleSheetsDataSource(); + var dataSourceItem = new GoogleSheetsDataSourceItem("Test", dataSource); + var pivotTable = "PivotTableTest"; + + // Act + dataSourceItem.PivotTable = pivotTable; + + // Assert + Assert.Equal(pivotTable, dataSourceItem.PivotTable); + Assert.Equal(pivotTable, dataSourceItem.Properties.GetValue("PivotTable")); + } + + [Fact] + public void Sheet_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleSheetsDataSource(); + var dataSourceItem = new GoogleSheetsDataSourceItem("Test", dataSource); + var sheet = "SheetTest"; + + // Act + dataSourceItem.Sheet = sheet; + + // Assert + Assert.Equal(sheet, dataSourceItem.Sheet); + Assert.Equal(sheet, dataSourceItem.Properties.GetValue("Sheet")); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleAnalytics4DataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleAnalytics4DataSourceFixture.cs new file mode 100644 index 0000000..76d7989 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleAnalytics4DataSourceFixture.cs @@ -0,0 +1,18 @@ +using Reveal.Sdk.Dom.Data; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSources +{ + public class GoogleAnalytics4DataSourceFixture + { + [Fact] + public void Constructor_SetProviderToGoogleAnalytics4_WhenConstructed() + { + // Act + var dataSource = new GoogleAnalytics4DataSource(); + + // Assert + Assert.Equal(DataSourceProvider.GoogleAnalytics4, dataSource.Provider); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleBigQueryDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleBigQueryDataSourceFixture.cs new file mode 100644 index 0000000..49352f0 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleBigQueryDataSourceFixture.cs @@ -0,0 +1,39 @@ +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSources +{ + public class GoogleBigQueryDataSourceFixture + { + [Fact] + public void Constructor_SetProviderToGoogleBigQuery_WhenConstructed() + { + // Act + var dataSource = new GoogleBigQueryDataSource(); + + // Assert + Assert.Equal(DataSourceProvider.GoogleBigQuery, dataSource.Provider); + } + + [Fact] + public void ProjectId_SaveValueAndProperties_WhenSet() + { + // Arrange + var dataSource = new GoogleBigQueryDataSource(); + var projectId = "TestProjectId"; + + // Act + dataSource.ProjectId = projectId; + + // Assert + Assert.Equal(projectId, dataSource.ProjectId); + Assert.Equal(projectId, dataSource.Properties.GetValue("ProjectId")); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleDriveDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleDriveDataSourceFixture.cs new file mode 100644 index 0000000..c07cf9d --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleDriveDataSourceFixture.cs @@ -0,0 +1,24 @@ +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSources +{ + public class GoogleDriveDataSourceFixture + { + [Fact] + public void Constructor_SetProviderToGoogleDrive_WhenConstructed() + { + // Act + var dataSource = new GoogleDriveDataSource(); + + // Assert + Assert.Equal(DataSourceProvider.GoogleDrive, dataSource.Provider); + } + } +} diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleSheetsDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleSheetsDataSourceFixture.cs new file mode 100644 index 0000000..d4d5f08 --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/GoogleSheetsDataSourceFixture.cs @@ -0,0 +1,25 @@ +using Reveal.Sdk.Dom.Core.Extensions; +using Reveal.Sdk.Dom.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Data.DataSources +{ + public class GoogleSheetsDataSourceFixture + { + + [Fact] + public void Constructor_SetProviderToGoogleSheets_WhenConstructed() + { + // Act + var dataSource = new GoogleSheetsDataSource(); + + // Assert + Assert.Equal(DataSourceProvider.GoogleSheets, dataSource.Provider); + } + } +}