{"action":"closed","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/37","repository_url":"https://api.github.com/repos/Particular/NServiceBus.Testing","labels_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/37/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/37/events","html_url":"https://github.com/Particular/NServiceBus.Testing/issues/37","id":131934068,"number":37,"title":"Messaging best practices are not enforced","user":{"login":"SeanFeldman","id":1309622,"avatar_url":"https://avatars.githubusercontent.com/u/1309622?v=3","gravatar_id":"","url":"https://api.github.com/users/SeanFeldman","html_url":"https://github.com/SeanFeldman","followers_url":"https://api.github.com/users/SeanFeldman/followers","following_url":"https://api.github.com/users/SeanFeldman/following{/other_user}","gists_url":"https://api.github.com/users/SeanFeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanFeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanFeldman/subscriptions","organizations_url":"https://api.github.com/users/SeanFeldman/orgs","repos_url":"https://api.github.com/users/SeanFeldman/repos","events_url":"https://api.github.com/users/SeanFeldman/events{/privacy}","received_events_url":"https://api.github.com/users/SeanFeldman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus.Testing/labels/Withdrawn:%20Won't%20Fix","name":"Withdrawn: Won't Fix","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-07T04:18:26Z","updated_at":"2016-03-04T11:29:00Z","closed_at":"2016-03-04T11:29:00Z","body":"[Messaging best practices](http://docs.particular.net/nservicebus/messaging/messages-events-commands), which are enabled by default in NSB, are not enabled for the NSB testing framework and it appears there's not way to control it.\r\n\r\n**Repro**\r\n\r\n```c#\r\n    public class SomeSaga : Saga<State>, IAmStartedByMessages<SomethingHappened>\r\n    {\r\n        public void Handle(SomethingHappened message)\r\n        {\r\n            Bus.Publish<Finished>(e => e.InitialData = message.What);\r\n            \r\n            MarkAsComplete();\r\n        }\r\n\r\n        protected override void ConfigureHowToFindSaga(SagaPropertyMapper<State> mapper)\r\n        {\r\n            mapper.ConfigureMapping<SomethingHappened>(m => m.What).ToSaga(s => s.What);\r\n        }\r\n    }\r\n\r\n    public class State : ContainSagaData\r\n    {\r\n        public string What { get; set; }\r\n    }\r\n\r\n    public interface SomethingHappened : IEvent\r\n    {\r\n        string What { get; set; }\r\n    }\r\n\r\n    // event converted into command should cause the test below to fail, but it doesn't\r\n    public interface Finished : /*IEvent*/ ICommand\r\n    {\r\n        string InitialData { get; set; }\r\n    }\r\n\r\n    [TestFixture]\r\n    public class When_starting_a_saga_with_an_interface_based_event\r\n    {\r\n        [Test]\r\n        public void Should_work()\r\n        {\r\n            Test.Initialize(configuration => configuration.Conventions().DefiningEventsAs(type => type.Name.Contains(\"SomethingHappened\")));\r\n            Test.Saga<SomeSaga>()\r\n                .ExpectPublish<Finished>(e => e.InitialData == \"123\")\r\n                .WhenHandling<SomethingHappened>(m => m.What = \"123\")\r\n                .AssertSagaCompletionIs(true);\r\n        }\r\n    }\r\n```\r\n\r\nRelated Google Groups question ([link](https://groups.google.com/forum/#!topic/particularsoftware/0V7NaCyoQ98))"}}