public void HandlersShouldSetCapabilitiesForManifest() { var thing = new StubHandler(); var thingToo = new StubTooHandler(); var builder = new ContainerBuilder(); builder.RegisterType<LiveWriterController>(); builder.RegisterType<XmlRpcReader>().As<IXmlRpcReader>(); builder.RegisterType<XmlRpcWriter>().As<IXmlRpcWriter>(); builder.RegisterInstance(thing).As<IXmlRpcHandler>(); builder.RegisterInstance(thingToo).As<IXmlRpcHandler>(); var container = builder.Build(); var controller = container.Resolve<LiveWriterController>(); var result = controller.Manifest() as ContentResult; Assert.That(result, Is.Not.Null); Assert.That(result.Content, Is.StringContaining("<supportsGetTags>No</supportsGetTags>")); Assert.That(result.Content, Is.StringContaining("<keywordsAsTags>Yes</keywordsAsTags>")); Assert.That(result.Content, Is.StringContaining("<supportsKeywords>Maybe</supportsKeywords>")); }
public void HandlersShouldSetCapabilitiesForManifest() { var thing = new StubHandler(); var thingToo = new StubTooHandler(); var builder = new ContainerBuilder(); builder.RegisterType <LiveWriterController>(); builder.RegisterType <XmlRpcReader>().As <IXmlRpcReader>(); builder.RegisterType <XmlRpcWriter>().As <IXmlRpcWriter>(); builder.RegisterInstance(thing).As <IXmlRpcHandler>(); builder.RegisterInstance(thingToo).As <IXmlRpcHandler>(); var container = builder.Build(); var controller = container.Resolve <LiveWriterController>(); var result = controller.Manifest() as ContentResult; Assert.That(result, Is.Not.Null); Assert.That(result.Content, Is.StringContaining("<supportsGetTags>No</supportsGetTags>")); Assert.That(result.Content, Is.StringContaining("<keywordsAsTags>Yes</keywordsAsTags>")); Assert.That(result.Content, Is.StringContaining("<supportsKeywords>Maybe</supportsKeywords>")); }