Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable doc tests with new test infra #391

Merged
merged 9 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/Doc/Bf_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ namespace Doc;

// HIDE_START
public class Bf_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Bf_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Bitmap_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ namespace Doc;

// HIDE_START
public class Bitmap_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Bitmap_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
13 changes: 13 additions & 0 deletions tests/Doc/CmdsGenericExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ namespace Doc;

// HIDE_START
public class CmdsGenericExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public CmdsGenericExample(EndpointsFixture fixture) : base(fixture) { }

[SkipIfRedis(Comparison.LessThan, "7.0.0")]
[InlineData] // No parameters passed, but still uses Theory
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/CmdsHashExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ namespace Doc;

// HIDE_START
public class CmdsHashExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public CmdsHashExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/CmdsSortedSetExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ namespace Doc;

// HIDE_START
public class CmdsSortedSet
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public CmdsSortedSet(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/CmdsStringExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ namespace Doc;

// HIDE_START
public class CmdsStringExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public CmdsStringExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Cms_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,22 @@ namespace Doc;

// HIDE_START
public class Cms_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Cms_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Cuckoo_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ namespace Doc;

// HIDE_START
public class Cuckoo_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Cuckoo_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Geo_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ namespace Doc;

// HIDE_START
public class Geo_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Geo_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/HashExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@ namespace Doc;
[Collection("DocsTests")]
//REMOVE_END
public class HashExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public HashExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
db.KeyDelete("bike:1");
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Hll_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ namespace Doc;

// HIDE_START
public class Hll_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Hll_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
13 changes: 13 additions & 0 deletions tests/Doc/HomeJsonExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ namespace Doc;

// HIDE_START
public class HomeJsonExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public HomeJsonExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END

// STEP_START connect
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/Json_tutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,22 @@ namespace Doc;

// HIDE_START
public class Json_tutorial
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public Json_tutorial(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
13 changes: 13 additions & 0 deletions tests/Doc/ListTutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ namespace Doc;
[Collection("DocsTests")]
//REMOVE_END
public class ListExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public ListExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//HIDE_END
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/QueryAggExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ namespace Doc;

// HIDE_START
public class QueryAggExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public QueryAggExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/QueryEmExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ namespace Doc;

// HIDE_START
public class QueryEmExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public QueryEmExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
12 changes: 12 additions & 0 deletions tests/Doc/QueryFtExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ namespace Doc;

// HIDE_START
public class QueryFtExample
// REMOVE_START
: AbstractNRedisStackTest, IDisposable
// REMOVE_END
{
// REMOVE_START
public QueryFtExample(EndpointsFixture fixture) : base(fixture) { }

[SkippableFact]
// REMOVE_END
public void run()
{
//REMOVE_START
// This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
SkipIfTargetConnectionDoesNotExist(EndpointsFixture.Env.Standalone);
var _ = GetCleanDatabase(EndpointsFixture.Env.Standalone);
//REMOVE_END
var muxer = ConnectionMultiplexer.Connect("localhost:6379");
var db = muxer.GetDatabase();
//REMOVE_START
Expand Down
Loading
Loading