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 StackExchange.Redis.KeyspaceIsolation;
using System.Text;
using Xunit;
namespace StackExchange.Redis.Tests
{
public sealed class BatchWrapperTests
{
private readonly Mock<IBatch> mock;
private readonly BatchWrapper wrapper;
public BatchWrapperTests()
{
mock = new Mock<IBatch>();
wrapper = new BatchWrapper(mock.Object, Encoding.UTF8.GetBytes("prefix:"));
}
[Fact]
public void Execute()
{
wrapper.Execute();
mock.Verify(_ => _.Execute(), Times.Once());
}
}
}
using Moq;
using StackExchange.Redis.KeyspaceIsolation;
using System.Text;
using Xunit;
namespace StackExchange.Redis.Tests
{
public sealed class BatchWrapperTests
{
private readonly Mock<IBatch> mock;
private readonly BatchWrapper wrapper;
public BatchWrapperTests()
{
mock = new Mock<IBatch>();
wrapper = new BatchWrapper(mock.Object, Encoding.UTF8.GetBytes("prefix:"));
}
[Fact]
public void Execute()
{
wrapper.Execute();
mock.Verify(_ => _.Execute(), Times.Once());
}
}
}
This diff is collapsed.
using System;
using Xunit;
using Xunit.Abstractions;
namespace StackExchange.Redis.Tests.Issues
{
public class Issue25 : TestBase
{
public Issue25(ITestOutputHelper output) : base (output) { }
[Fact]
public void CaseInsensitive()
{
var options = ConfigurationOptions.Parse("ssl=true");
Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString());
options = ConfigurationOptions.Parse("SSL=TRUE");
Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString());
}
[Fact]
public void UnkonwnKeywordHandling_Ignore()
{
var options = ConfigurationOptions.Parse("ssl2=true", true);
}
[Fact]
public void UnkonwnKeywordHandling_ExplicitFail()
{
var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true", false);
});
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
}
[Fact]
public void UnkonwnKeywordHandling_ImplicitFail()
{
var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true");
});
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
}
}
}
using System;
using Xunit;
using Xunit.Abstractions;
namespace StackExchange.Redis.Tests.Issues
{
public class Issue25 : TestBase
{
public Issue25(ITestOutputHelper output) : base (output) { }
[Fact]
public void CaseInsensitive()
{
var options = ConfigurationOptions.Parse("ssl=true");
Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString());
options = ConfigurationOptions.Parse("SSL=TRUE");
Assert.True(options.Ssl);
Assert.Equal("ssl=True", options.ToString());
}
[Fact]
public void UnkonwnKeywordHandling_Ignore()
{
var options = ConfigurationOptions.Parse("ssl2=true", true);
}
[Fact]
public void UnkonwnKeywordHandling_ExplicitFail()
{
var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true", false);
});
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
}
[Fact]
public void UnkonwnKeywordHandling_ImplicitFail()
{
var ex = Assert.Throws<ArgumentException>(() => {
var options = ConfigurationOptions.Parse("ssl2=true");
});
Assert.Equal("Keyword 'ssl2' is not supported", ex.Message);
}
}
}
This diff is collapsed.
namespace StackExchange.Redis.KeyspaceIsolation
{
internal sealed class BatchWrapper : WrapperBase<IBatch>, IBatch
{
public BatchWrapper(IBatch inner, byte[] prefix) : base(inner, prefix)
{
}
public void Execute()
{
Inner.Execute();
}
}
}
namespace StackExchange.Redis.KeyspaceIsolation
{
internal sealed class BatchWrapper : WrapperBase<IBatch>, IBatch
{
public BatchWrapper(IBatch inner, byte[] prefix) : base(inner, prefix)
{
}
public void Execute()
{
Inner.Execute();
}
}
}
using System.Threading.Tasks;
namespace StackExchange.Redis.KeyspaceIsolation
{
internal sealed class TransactionWrapper : WrapperBase<ITransaction>, ITransaction
{
public TransactionWrapper(ITransaction inner, byte[] prefix) : base(inner, prefix)
{
}
public ConditionResult AddCondition(Condition condition)
{
return Inner.AddCondition(condition?.MapKeys(GetMapFunction()));
}
public bool Execute(CommandFlags flags = CommandFlags.None)
{
return Inner.Execute(flags);
}
public Task<bool> ExecuteAsync(CommandFlags flags = CommandFlags.None)
{
return Inner.ExecuteAsync(flags);
}
public void Execute()
{
Inner.Execute();
}
}
}
using System.Threading.Tasks;
namespace StackExchange.Redis.KeyspaceIsolation
{
internal sealed class TransactionWrapper : WrapperBase<ITransaction>, ITransaction
{
public TransactionWrapper(ITransaction inner, byte[] prefix) : base(inner, prefix)
{
}
public ConditionResult AddCondition(Condition condition)
{
return Inner.AddCondition(condition?.MapKeys(GetMapFunction()));
}
public bool Execute(CommandFlags flags = CommandFlags.None)
{
return Inner.Execute(flags);
}
public Task<bool> ExecuteAsync(CommandFlags flags = CommandFlags.None)
{
return Inner.ExecuteAsync(flags);
}
public void 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