Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        static ApiBestPracticeTestBase()
        {
            string swaggerFile;

            using (Stream resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Jab.Fixtures.swagger.json"))
                using (StreamReader stringReader = new StreamReader(resourceStream))
                {
                    swaggerFile = stringReader.ReadToEnd();
                }

            Configuration = new JabTestConfiguration(swaggerFile, null);
        }
Ejemplo n.º 2
0
        public void Ctor_NullBaseUrl()
        {
            JabTestConfiguration jabTestConfiguration;

            jabTestConfiguration = new JabTestConfiguration(SwaggerJson, null);

            Assert.That(
                jabTestConfiguration,
                Has.Property("SwaggerService").Not.Null
                .And.Property("SwaggerService").Property("Paths").Empty);
            Assert.That(
                jabTestConfiguration,
                Has.Property("BaseUrl").Null);
        }
Ejemplo n.º 3
0
        public void Ctor_SuppliedBaseUrl()
        {
            JabTestConfiguration jabTestConfiguration;
            Uri baseUrl;

            baseUrl = new Uri("http://myapi.com");

            jabTestConfiguration = new JabTestConfiguration(SwaggerJson, baseUrl);

            Assert.That(
                jabTestConfiguration,
                Has.Property("SwaggerService").Not.Null
                .And.Property("SwaggerService").Property("Paths").Empty);
            Assert.That(
                jabTestConfiguration,
                Has.Property("BaseUrl").EqualTo(baseUrl));
        }