Skip to content

Commit

Permalink
Make the sample project testable for future usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawxy committed Jun 14, 2024
1 parent 467efe8 commit a16c6e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
11 changes: 10 additions & 1 deletion src/samples/DocsSamples/DocsSamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Docs.Samples</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Marten.Testing\Marten.Testing.csproj" />
<ProjectReference Include="..\..\Marten\Marten.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions src/samples/DocsSamples/EventSourcingQuickstart.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Marten;
using Marten.Events.Aggregation;
using Marten.Events.Projections;
using Marten.Testing.Harness;

namespace Docs.Samples;

Expand Down Expand Up @@ -91,7 +92,7 @@ public async Task capture_events()

var store = DocumentStore.For(_ =>
{
_.Connection(ExampleConstants.ConnectionString);
_.Connection(ConnectionSource.ConnectionString);
});

var questId = Guid.NewGuid();
Expand Down Expand Up @@ -136,7 +137,7 @@ public async Task quest_projection()
#region sample_adding-quest-projection
var store = DocumentStore.For(_ =>
{
_.Connection(ExampleConstants.ConnectionString);
_.Connection(ConnectionSource.ConnectionString);
_.Projections.Add<QuestProjection>(ProjectionLifecycle.Inline); // [!code ++]
});
#endregion
Expand Down
6 changes: 0 additions & 6 deletions src/samples/DocsSamples/ExampleConstants.cs

This file was deleted.

0 comments on commit a16c6e2

Please sign in to comment.