예제 #1
0
        public async Task Test_SelectWithSubscriptionClient()
        {
            Exception thrownException = null;
            var       dut             = new AsyncRedisSubscriptionClient();

            try
            {
                await dut.Connect(LocalHostDefaultPort.AsConnectionSettings());

                await dut.Select(1);
            }
            catch (Exception ex)
            {
                thrownException = ex;
            }

            Assert.IsNull(thrownException);
        }
예제 #2
0
        public async Task TestWrongDbIndex_SelectWithSubscriptionClientThrowsException()
        {
            Exception thrownException = null;
            var       dut             = new AsyncRedisSubscriptionClient();

            try
            {
                await dut.Connect(LocalHostDefaultPort.AsConnectionSettings());

                await dut.Select(int.MaxValue);
            }
            catch (Exception ex)
            {
                thrownException = ex;
            }

            Assert.IsNotNull(thrownException);
            Assert.IsInstanceOfType(thrownException, typeof(RedisException));
        }
예제 #3
0
        public async Task TestCallingAfterDispose_SubscriptionClientThrowsException()
        {
            Exception thrownException = null;

            var dut = new AsyncRedisSubscriptionClient();
            await dut.Connect(LocalHostDefaultPort.AsConnectionSettings());

            dut.Dispose();

            try
            {
                await dut.Select(1);
            }
            catch (Exception ex)
            {
                thrownException = ex;
            }

            Assert.IsNotNull(thrownException);
            Assert.IsInstanceOfType(thrownException, typeof(InvalidOperationException));
        }