Example #1
0
 public TypeResolverVersioningTests()
 {
     _sut = new DefaultRequestTypeResolver("cedar.tests",
                                           new[]
     {
         typeof(SomeCommand), typeof(SomeCommand_v12), typeof(SomeCommand_v2), typeof(SomeCommand_v25), typeof(SomeCommand_v26)
     });
 }
        public void Should_get_command_type()
        {
            var resolver = new DefaultRequestTypeResolver("cedar.tests", new[] { typeof(TypeResolverTests) });

            var context = new OwinContext
            {
                Request =
                {
                    Protocol    = "HTTP/1.1",
                    Scheme      = "http",
                    Host        = new HostString("locahost"),
                    ContentType = @"application/vnd.cedar.tests.typeresolvertests+json"
                }
            };

            Type commandType = resolver.ResolveInputType(new CedarRequest(context));

            commandType.Should().NotBeNull();
        }