Skip to content

Commit

Permalink
Test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lundine committed Jan 26, 2024
1 parent dfaa6fe commit 4300a20
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions RediSearchClient.Tests/SpellCheckResultCollectionTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using StackExchange.Redis;
using Xunit;

namespace RediSearchClient.Tests
Expand Down Expand Up @@ -39,6 +40,15 @@ public void CanIterateUsingForEach()
Assert.Equal(5, count);
}

[Fact]
public void Create_ReturnsEmptyArray_WithNullInput()
{
RedisResult redisResult = RedisResult.Create(new RedisValue(null));
var res = SpellCheckResult.CreateArray(redisResult);

Assert.Empty(res);
}

[Fact]
public void CanGetASuggestionByIndex()
{
Expand Down
17 changes: 17 additions & 0 deletions RediSearchClient.Tests/SuggestionResultCollectionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using StackExchange.Redis;
using Xunit;

namespace RediSearchClient.Tests;

public class SuggestionResultCollectionTests
{
[Fact]
public void Create_ReturnsEmptyArray_WithNullInput()
{
RedisResult redisResult = RedisResult.Create(new RedisValue(null));
var res = SuggestionResult.CreateArray(redisResult, true, true);

Assert.Empty(res);
}

}

0 comments on commit 4300a20

Please sign in to comment.