public JsonFormatterExtensionsFixtures()
        {
            var serializerFactory =
               new DefaultSerializerFactory(new ISerializer[] { new DefaultJsonSerializer() });

            this.formatter = A.Fake<IResponseFormatter>();
            A.CallTo(() => this.formatter.SerializerFactory).Returns(serializerFactory);
            this.model = new Person { FirstName = "Andy", LastName = "Pike" };
            this.response = this.formatter.AsJson(model);
        }
        public XmlFormatterExtensionsFixtures()
        {
            this.rootPathProvider = A.Fake<IRootPathProvider>();

            var serializerFactory =
                new DefaultSerializerFactory(new ISerializer[] { new DefaultXmlSerializer() });

            this.responseFormatter =
                new DefaultResponseFormatter(this.rootPathProvider, new NancyContext(), serializerFactory);

            this.model = new Person { FirstName = "Andy", LastName = "Pike" };
            this.response = this.responseFormatter.AsXml(model);
        }
        public XmlFormatterExtensionsFixtures()
        {
            this.rootPathProvider = A.Fake<IRootPathProvider>();
            var environment = new DefaultNancyEnvironment();
            environment.AddValue(XmlConfiguration.Default);

            var serializerFactory =
                new DefaultSerializerFactory(new ISerializer[] { new DefaultXmlSerializer(environment) });

            this.responseFormatter =
                new DefaultResponseFormatter(this.rootPathProvider, new NancyContext(), serializerFactory, environment);

            this.model = new Person { FirstName = "Andy", LastName = "Pike" };
            this.response = this.responseFormatter.AsXml(model);
        }