Esempio n. 1
0
        public void GetFirst_Throws_On_InvalidKey()
        {
            var headers = new KafkaEventDataHeaders();

            headers.Add("test", Encoding.UTF8.GetBytes("testValue1"));

            Assert.Throws <KeyNotFoundException>(() => headers.GetFirst("test2"));
        }
Esempio n. 2
0
        public void GetFirst_Returns_The_Last_Header_Value()
        {
            var headers = new KafkaEventDataHeaders();

            headers.Add("test", Encoding.UTF8.GetBytes("testValue1"));
            headers.Add("test", Encoding.UTF8.GetBytes("testValue2"));

            var value = headers.GetFirst("test");

            Assert.Equal("testValue1", Encoding.UTF8.GetString(value));
        }