Skip to content

Commit 2be0214

Browse files
committed
initial design of the test entity to write into bigQuery
1 parent fadc5cb commit 2be0214

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
12+
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\AzureFunctions.Extensions.GoogleBigQuery\AzureFunctions.Extensions.GoogleBigQuery.csproj" />
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using System;
3+
4+
namespace AzureFunctions.Extensions.GoogleBigQuery.ComponentTests {
5+
[TestClass]
6+
public class BigQueryServiceTests {
7+
8+
[TestMethod]
9+
public void InsertRecord_NullablesNulls() {
10+
11+
//Arrange
12+
TestBigQueryRow testBigQueryRow = new TestBigQueryRow(DateTime.UtcNow, "insertId_1") {
13+
IntValue = 1,
14+
IntNullableValue = null
15+
};
16+
17+
18+
//Act
19+
20+
//Assert
21+
22+
}
23+
24+
}
25+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.ComponentModel.DataAnnotations.Schema;
3+
4+
namespace AzureFunctions.Extensions.GoogleBigQuery.ComponentTests {
5+
public class TestBigQueryRow : GoogleBigQueryRow {
6+
7+
public TestBigQueryRow(DateTime date, string insertId) : base(date, insertId) { }
8+
9+
//byte
10+
public System.Byte ByteValue { get; set; }
11+
public System.Byte? ByteNullableValue { get; set; }
12+
13+
//integer
14+
[Column] public int IntValue { get; set; }
15+
[Column] public System.Int16 Int16Value { get; set; }
16+
[Column] public System.Int32 Int32Value { get; set; }
17+
[Column] public System.Int64 Int64Value { get; set; }
18+
[Column] public System.UInt16 UInt16Value { get; set; }
19+
[Column] public System.UInt32 UInt32Value { get; set; }
20+
[Column] public System.UInt64 UInt64Value { get; set; }
21+
[Column] public int? IntNullableValue { get; set; }
22+
23+
public float MyProperty { get; set; }
24+
public double Double1Value { get; set; }
25+
public System.Double Double2Value { get; set; }
26+
public System.Boolean Boolean { get; set; }
27+
public System.Decimal Decimal { get; set; }
28+
public System.Single Single { get; set; }
29+
public System.Char Char { get; set; }
30+
public System.DateTime DateTime { get; set; }
31+
public System.DateTimeOffset DateTimeOffset { get; set; }
32+
33+
public String StringValue { get; set; }
34+
35+
public System.Guid GuidValue { get; set; }
36+
37+
38+
}
39+
}

AzureFunctions.Extensions.GoogleBigQuery.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27130.2010
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureFunctions.Extensions.GoogleBigQuery", "AzureFunctions.Extensions.GoogleBigQuery\AzureFunctions.Extensions.GoogleBigQuery.csproj", "{B781E2D4-4180-4BFA-96F3-EE4CB7E43E0D}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureFunctions.Extensions.GoogleBigQuery.ComponentTests", "AzureFunctions.Extensions.GoogleBigQuery.ComponentTests\AzureFunctions.Extensions.GoogleBigQuery.ComponentTests.csproj", "{06CDE008-8819-4EEB-90C1-BDA83029D09A}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{B781E2D4-4180-4BFA-96F3-EE4CB7E43E0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{B781E2D4-4180-4BFA-96F3-EE4CB7E43E0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{B781E2D4-4180-4BFA-96F3-EE4CB7E43E0D}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{06CDE008-8819-4EEB-90C1-BDA83029D09A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{06CDE008-8819-4EEB-90C1-BDA83029D09A}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{06CDE008-8819-4EEB-90C1-BDA83029D09A}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{06CDE008-8819-4EEB-90C1-BDA83029D09A}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)