Created
March 21, 2020 19:08
-
-
Save camous/45ed510cc14e1b0d9fba4e02b62bdbca to your computer and use it in GitHub Desktop.
unittest_routing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void TestMethod1() | |
{ | |
var servicebus = new NameSpace(); | |
var subscription1 = new Subscription { Name = "subscription1", Rules = new List<Rule> { new Rule { Filter = "flag='1'" } } }; | |
var subscription2 = new Subscription { Name = "subscription2", Rules = new List<Rule> { new Rule { Filter = "flag='2'" } } }; | |
servicebus.Topics.Add(new Topic { Name = "topic", Subscriptions = new List<Subscription> { subscription1, subscription2 } }); | |
var message = new Message | |
{ | |
CustomProperties = new Dictionary<string, object> | |
{ | |
{ "flag", "1" }, | |
} | |
}; | |
servicebus.AssertRouting("topic", message, new Dictionary<string, MessageState> { | |
{ "subscription1", MessageState.Transfered }, | |
{ "subscription2", MessageState.Ignored } | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment