Commit fb4a6308 authored by Nick Craver's avatar Nick Craver

Line endings fix: whole files

parent e6a3e65b
This diff is collapsed.
This diff is collapsed.
using Moq; using Moq;
using StackExchange.Redis.KeyspaceIsolation; using StackExchange.Redis.KeyspaceIsolation;
using System.Text; using System.Text;
using Xunit; using Xunit;
namespace StackExchange.Redis.Tests namespace StackExchange.Redis.Tests
{ {
public sealed class BatchWrapperTests public sealed class BatchWrapperTests
{ {
private readonly Mock<IBatch> mock; private readonly Mock<IBatch> mock;
private readonly BatchWrapper wrapper; private readonly BatchWrapper wrapper;
public BatchWrapperTests() public BatchWrapperTests()
{ {
mock = new Mock<IBatch>(); mock = new Mock<IBatch>();
wrapper = new BatchWrapper(mock.Object, Encoding.UTF8.GetBytes("prefix:")); wrapper = new BatchWrapper(mock.Object, Encoding.UTF8.GetBytes("prefix:"));
} }
[Fact] [Fact]
public void Execute() public void Execute()
{ {
wrapper.Execute(); wrapper.Execute();
mock.Verify(_ => _.Execute(), Times.Once()); mock.Verify(_ => _.Execute(), Times.Once());
} }
} }
} }
This diff is collapsed.
using System; using System;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;
namespace StackExchange.Redis.Tests.Issues namespace StackExchange.Redis.Tests.Issues
{ {
public class Issue25 : TestBase public class Issue25 : TestBase
{ {
public Issue25(ITestOutputHelper output) : base (output) { } public Issue25(ITestOutputHelper output) : base (output) { }
[Fact] [Fact]
public void CaseInsensitive() public void CaseInsensitive()
{ {
var options = ConfigurationOptions.Parse("ssl=true"); var options = ConfigurationOptions.Parse("ssl=true");
Assert.True(options.Ssl); Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString()); Assert.Equal("ssl=True", options.ToString());
options = ConfigurationOptions.Parse("SSL=TRUE"); options = ConfigurationOptions.Parse("SSL=TRUE");
Assert.True(options.Ssl); Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString()); Assert.Equal("ssl=True", options.ToString());
} }
[Fact] [Fact]
public void UnkonwnKeywordHandling_Ignore() public void UnkonwnKeywordHandling_Ignore()
{ {
var options = ConfigurationOptions.Parse("ssl2=true", true); var options = ConfigurationOptions.Parse("ssl2=true", true);
} }
[Fact] [Fact]
public void UnkonwnKeywordHandling_ExplicitFail() public void UnkonwnKeywordHandling_ExplicitFail()
{ {
var ex = Assert.Throws<ArgumentException>(() => { var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true", false); var options = ConfigurationOptions.Parse("ssl2=true", false);
}); });
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message); Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
} }
[Fact] [Fact]
public void UnkonwnKeywordHandling_ImplicitFail() public void UnkonwnKeywordHandling_ImplicitFail()
{ {
var ex = Assert.Throws<ArgumentException>(() => { var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true"); var options = ConfigurationOptions.Parse("ssl2=true");
}); });
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message); Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
} }
} }
} }
This diff is collapsed.
namespace StackExchange.Redis.KeyspaceIsolation namespace StackExchange.Redis.KeyspaceIsolation
{ {
internal sealed class BatchWrapper : WrapperBase<IBatch>, IBatch internal sealed class BatchWrapper : WrapperBase<IBatch>, IBatch
{ {
public BatchWrapper(IBatch inner, byte[] prefix) : base(inner, prefix) public BatchWrapper(IBatch inner, byte[] prefix) : base(inner, prefix)
{ {
} }
public void Execute() public void Execute()
{ {
Inner.Execute(); Inner.Execute();
} }
} }
} }
using System.Threading.Tasks; using System.Threading.Tasks;
namespace StackExchange.Redis.KeyspaceIsolation namespace StackExchange.Redis.KeyspaceIsolation
{ {
internal sealed class TransactionWrapper : WrapperBase<ITransaction>, ITransaction internal sealed class TransactionWrapper : WrapperBase<ITransaction>, ITransaction
{ {
public TransactionWrapper(ITransaction inner, byte[] prefix) : base(inner, prefix) public TransactionWrapper(ITransaction inner, byte[] prefix) : base(inner, prefix)
{ {
} }
public ConditionResult AddCondition(Condition condition) public ConditionResult AddCondition(Condition condition)
{ {
return Inner.AddCondition(condition?.MapKeys(GetMapFunction())); return Inner.AddCondition(condition?.MapKeys(GetMapFunction()));
} }
public bool Execute(CommandFlags flags = CommandFlags.None) public bool Execute(CommandFlags flags = CommandFlags.None)
{ {
return Inner.Execute(flags); return Inner.Execute(flags);
} }
public Task<bool> ExecuteAsync(CommandFlags flags = CommandFlags.None) public Task<bool> ExecuteAsync(CommandFlags flags = CommandFlags.None)
{ {
return Inner.ExecuteAsync(flags); return Inner.ExecuteAsync(flags);
} }
public void Execute() public void Execute()
{ {
Inner.Execute(); Inner.Execute();
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment