Skip to content

Commit 434ec8f

Browse files
committed
Added integration test shell.
1 parent fb7e312 commit 434ec8f

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="coverlet.collector" Version="6.0.2" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
13+
<PackageReference Include="xunit" Version="2.9.2" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<Using Include="Xunit" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<ProjectReference Include="..\..\..\PowerSync\PowerSync.Common\PowerSync.Common.csproj" />
23+
</ItemGroup>
24+
25+
</Project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
namespace PowerSync.Common.Tests;
2+
3+
using PowerSync.Common.DB.Schema;
4+
5+
public class TestSchema
6+
{
7+
public static Table Todos = new Table(new Dictionary<string, ColumnType>
8+
{
9+
{ "list_id", ColumnType.TEXT },
10+
{ "created_at", ColumnType.TEXT },
11+
{ "completed_at", ColumnType.TEXT },
12+
{ "description", ColumnType.TEXT },
13+
{ "created_by", ColumnType.TEXT },
14+
{ "completed_by", ColumnType.TEXT },
15+
{ "completed", ColumnType.INTEGER }
16+
}, new TableOptions
17+
{
18+
Indexes = new Dictionary<string, List<string>> { { "list", new List<string> { "list_id" } } }
19+
});
20+
21+
public static Table Lists = new Table(new Dictionary<string, ColumnType>
22+
{
23+
{ "created_at", ColumnType.TEXT },
24+
{ "name", ColumnType.TEXT },
25+
{ "owner_id", ColumnType.TEXT }
26+
});
27+
28+
public static Schema PowerSyncSchema = new Schema(new Dictionary<string, Table>
29+
{
30+
{ "todos", Todos },
31+
{ "lists", Lists }
32+
});
33+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace PowerSync.Common.IntegrationTests;
2+
3+
public class UnitTest1
4+
{
5+
[Fact]
6+
public void Test1()
7+
{
8+
9+
}
10+
}

root.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF", "demos\WPF\WPF.csproj
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSync.Maui", "PowerSync\PowerSync.Maui\PowerSync.Maui.csproj", "{A4A91B9F-0C86-41CB-BEF0-C002819C43BE}"
2525
EndProject
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSync.Common.IntegrationTests", "Tests\PowerSync\PowerSync.Common.IntegrationTests\PowerSync.Common.IntegrationTests.csproj", "{EB81D453-777D-40B5-A504-4144906ADBF4}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -105,6 +107,18 @@ Global
105107
{A4A91B9F-0C86-41CB-BEF0-C002819C43BE}.Release|x64.Build.0 = Release|Any CPU
106108
{A4A91B9F-0C86-41CB-BEF0-C002819C43BE}.Release|x86.ActiveCfg = Release|Any CPU
107109
{A4A91B9F-0C86-41CB-BEF0-C002819C43BE}.Release|x86.Build.0 = Release|Any CPU
110+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
111+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
112+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|x64.ActiveCfg = Debug|Any CPU
113+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|x64.Build.0 = Debug|Any CPU
114+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|x86.ActiveCfg = Debug|Any CPU
115+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Debug|x86.Build.0 = Debug|Any CPU
116+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
117+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|Any CPU.Build.0 = Release|Any CPU
118+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|x64.ActiveCfg = Release|Any CPU
119+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|x64.Build.0 = Release|Any CPU
120+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|x86.ActiveCfg = Release|Any CPU
121+
{EB81D453-777D-40B5-A504-4144906ADBF4}.Release|x86.Build.0 = Release|Any CPU
108122
EndGlobalSection
109123
GlobalSection(SolutionProperties) = preSolution
110124
HideSolutionNode = FALSE
@@ -117,5 +131,6 @@ Global
117131
{B8B2A9E2-FEC9-495B-B03E-23078E7B651D} = {9144195A-C68F-4B1E-A574-474EDD424D6C}
118132
{AF297026-0BEA-4B8E-97C9-6540C6D52B36} = {9144195A-C68F-4B1E-A574-474EDD424D6C}
119133
{A4A91B9F-0C86-41CB-BEF0-C002819C43BE} = {B1D87BA9-8812-4EFA-BBBE-1FF1EEEB5433}
134+
{EB81D453-777D-40B5-A504-4144906ADBF4} = {C784FBE4-CC1E-4A0A-AE8E-6B818DD3724D}
120135
EndGlobalSection
121136
EndGlobal

0 commit comments

Comments
 (0)