Exemplo n.º 1
0
        public void GetSequenceExtensionMethods_Null()
        {
            var cloudEvent = new CloudEvent();

            Assert.Null(cloudEvent.GetSequenceValue());
            Assert.Null(cloudEvent.GetSequenceString());
            Assert.Null(cloudEvent.GetSequenceType());
        }
Exemplo n.º 2
0
        public void GetSequenceExtensionMethods_UnknownType()
        {
            var cloudEvent = new CloudEvent
            {
                ["sequencetype"] = "Mystery",
                ["sequence"]     = "xyz"
            };

            Assert.Equal("Mystery", cloudEvent.GetSequenceType());
            Assert.Equal("xyz", cloudEvent.GetSequenceString());
            Assert.Throws <InvalidOperationException>(() => cloudEvent.GetSequenceValue());
        }
Exemplo n.º 3
0
        public void GetSequenceExtensionMethods_Integer()
        {
            var cloudEvent = new CloudEvent
            {
                ["sequencetype"] = "Integer",
                ["sequence"]     = "25"
            };

            Assert.Equal(25, cloudEvent.GetSequenceValue());
            Assert.Equal("25", cloudEvent.GetSequenceString());
            Assert.Equal("Integer", cloudEvent.GetSequenceType());
        }