Exemplo n.º 1
0
        public async Task Should_Throw_SerializationException_When_ItemFormatterFails()
        {
            using var cluster = GetCustomCluster();
            var client = new MemcachedClient(cluster);

            await Assert.ThrowsAsync <SerializationException>(() => client.SetAsync("aaaaa", new { A = "a" }));
        }
Exemplo n.º 2
0
        public async Task Should_Throw_ArgumentException_When_Key_Is_Too_Long()
        {
            using var cluster = GetCustomCluster();
            var client = new MemcachedClient(cluster);

            var exception = await Assert.ThrowsAsync <ArgumentException>(() => client.SetAsync(new string('a', 65536), "aaaa"));

            Assert.StartsWith("Key is too long; was 65536, maximum is", exception.Message);
        }