{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2864","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2864/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2864/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2864/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2864","id":378837915,"node_id":"MDU6SXNzdWUzNzg4Mzc5MTU=","number":2864,"title":"Mapper.AssertConfigurationIsValid() doesn't throw exception about enum not matching","user":{"login":"stevenxi","id":3340119,"node_id":"MDQ6VXNlcjMzNDAxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3340119?v=4","gravatar_id":"","url":"https://api.github.com/users/stevenxi","html_url":"https://github.com/stevenxi","followers_url":"https://api.github.com/users/stevenxi/followers","following_url":"https://api.github.com/users/stevenxi/following{/other_user}","gists_url":"https://api.github.com/users/stevenxi/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenxi/subscriptions","organizations_url":"https://api.github.com/users/stevenxi/orgs","repos_url":"https://api.github.com/users/stevenxi/repos","events_url":"https://api.github.com/users/stevenxi/events{/privacy}","received_events_url":"https://api.github.com/users/stevenxi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-08T17:24:33Z","updated_at":"2018-11-09T09:35:54Z","closed_at":null,"author_association":"NONE","body":"<!-- For feature requests, just clear out the below \r\nTry to provide [a minimal, complete, and verifiable example](https://stackoverflow.com/help/mcve), preferably a [gist](https://gist.github.com/lbargaoanu/9c7233441c3a3413cc2b9b9ebb5964a9) that we can execute and see fail. [Here](https://gist.github.com/lbargaoanu/0cbc531306223f7ffc5468becf2642d6) is an example for ProjectTo.\r\n-->\r\n\r\n### Source/destination types\r\n\r\n```csharp\r\nSource \r\nenum SourceEnum\r\n{\r\n a,\r\n b\r\n}\r\n\r\nDestination\r\nenum DestinationEnum\r\n{\r\n b\r\n}\r\n\r\n```\r\n\r\n### Mapping configuration\r\n\r\n```csharp\r\n\r\n       \r\n        public class MappingProfile : Profile\r\n        {\r\n            public MappingProfile()\r\n            {\r\n                CreateMap<SourceEnum, DestinationEnum>();\r\n            }\r\n        }\r\n\r\n            Mapper.Initialize(cfg =>\r\n            {\r\n                cfg.AddProfile(new MappingProfile());\r\n            });\r\n\r\n\r\n\r\n\r\n```\r\n\r\n### Version: x.y.z\r\n7.0.1\r\n\r\n### Expected behavior\r\n\r\nMapper.AssertConfigurationIsValid(); //Should throw exception\r\n\r\n### Actual behavior\r\n\r\nMapper.AssertConfigurationIsValid(); //No exception\r\n\r\n### Steps to reproduce\r\n\r\n```csharp\r\n\r\n        enum SourceEnum\r\n        {\r\n            a,\r\n            b\r\n        }\r\n\r\n        enum DestinationEnum\r\n        {\r\n            b\r\n        }\r\n\r\n        public class MappingProfile : Profile\r\n        {\r\n            public MappingProfile()\r\n            {\r\n                CreateMap<SourceEnum, DestinationEnum>();\r\n            }\r\n        }\r\n\r\n            Mapper.Initialize(cfg =>\r\n            {\r\n                cfg.AddProfile(new MappingProfile());\r\n            });\r\n\r\n            Mapper.AssertConfigurationIsValid();\r\n\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/437303664","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2864#issuecomment-437303664","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2864","id":437303664,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzMwMzY2NA==","user":{"login":"stevenxi","id":3340119,"node_id":"MDQ6VXNlcjMzNDAxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3340119?v=4","gravatar_id":"","url":"https://api.github.com/users/stevenxi","html_url":"https://github.com/stevenxi","followers_url":"https://api.github.com/users/stevenxi/followers","following_url":"https://api.github.com/users/stevenxi/following{/other_user}","gists_url":"https://api.github.com/users/stevenxi/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenxi/subscriptions","organizations_url":"https://api.github.com/users/stevenxi/orgs","repos_url":"https://api.github.com/users/stevenxi/repos","events_url":"https://api.github.com/users/stevenxi/events{/privacy}","received_events_url":"https://api.github.com/users/stevenxi/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T09:35:54Z","updated_at":"2018-11-09T09:35:54Z","author_association":"NONE","body":"@lbargaoanu Clearly the Mapper.AssertConfigurationIsValid(); should be mostly used for unit testing.\r\nI do agree the code trying to avoid errors during runtime, but it's not a good idea to hide errors during unit testing.\r\n"}}
{"actor":{"display_login":"stevenxi"}}