public void IgnoresNoInitialization() { var initializer = new ConnectionInitializer(new RedisClientOptions()); var writtingStream = new MemoryStream(); var reader = new DummySocketReader(null); var writer = new DummySocketWriter(writtingStream); initializer.Initialize(reader, writer); }
public void DetectMissingResponseErrors() { var options = new RedisClientOptions(); options.InitializationCommands.Add(new PreInitializationCommand("auth vtortola")); var initializer = new ConnectionInitializer(options); var writtingStream = new MemoryStream(); var reader = new DummySocketReader(null); var writer = new DummySocketWriter(writtingStream); initializer.Initialize(reader, writer); }
public void InitializesWithCommands() { var options = new RedisClientOptions(); options.InitializationCommands.Add(new PreInitializationCommand("auth vtortola")); var initializer = new ConnectionInitializer(options); var writtingStream = new MemoryStream(); var reader = new DummySocketReader("+OK\r\n"); var writer = new DummySocketWriter(writtingStream); initializer.Initialize(reader, writer); writtingStream.Seek(0, SeekOrigin.Begin); Assert.AreEqual("*2\r\n$4\r\nAUTH\r\n$8\r\nvtortola\r\n", new StreamReader(writtingStream).ReadToEnd()); }