static ApisJson GetExceptedApisJsonForServerNoSecurity()
        {
            var exceptedApisJsonForServerNoSecurity = new ApisJson
            {
                Name                 = EnvironmentVariables.PublicWebServerUri,
                Created              = DateTime.Today.Date,
                Modified             = DateTime.Today.Date,
                Description          = "",
                Url                  = EnvironmentVariables.PublicWebServerUri + "apis.json",
                SpecificationVersion = "0.15",
                Apis                 = new List <SingleApi>()
            };
            var singleApi1 = new SingleApi
            {
                Name        = "Hello World",
                Description = "",
                BaseUrl     = EnvironmentVariables.PublicWebServerUri + "secure/Hello World.json",
                Properties  = new List <PropertyApi>()
            };
            var swagger1 = new PropertyApi
            {
                Type  = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + "secure/Hello World.api"
            };

            singleApi1.Properties.Add(swagger1);

            var singleApi2 = new SingleApi
            {
                Name        = "Execution Engine Test",
                Description = "",
                BaseUrl     = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.json",
                Properties  = new List <PropertyApi>()
            };
            var swagger2 = new PropertyApi
            {
                Type  = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.api"
            };

            singleApi2.Properties.Add(swagger2);
            var singleApi3 = new SingleApi
            {
                Name        = "9139Local",
                Description = "",
                BaseUrl     = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/9139Local.json",
                Properties  = new List <PropertyApi>()
            };
            var swagger3 = new PropertyApi
            {
                Type  = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/9139Local.api"
            };

            singleApi3.Properties.Add(swagger3);
            exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi1);
            exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi2);
            exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi3);
            return(exceptedApisJsonForServerNoSecurity);
        }
        static ApisJson GetExceptedApisJsonForServerPathWithNoSubDirectories()
        {
            var exceptedApisJsonForServerNoSecurity = new ApisJson
            {
                Name                 = EnvironmentVariables.PublicWebServerUri,
                Created              = DateTime.Today.Date,
                Modified             = DateTime.Today.Date,
                Description          = "",
                Url                  = EnvironmentVariables.PublicWebServerUri + "Acceptance Testing Resources/Execution Engine/apis.json",
                SpecificationVersion = "0.15",
                Apis                 = new List <SingleApi>()
            };

            var singleApi2 = new SingleApi
            {
                Name        = "Execution Engine Test",
                Description = "",
                BaseUrl     = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.json",
                Properties  = new List <PropertyApi>(),
                HumanUrl    = "https://warewolf.io",
                Image       = "https://warewolf.io/images/logo.png",
                Version     = "1.0",
                Tags        = new List <string>()
            };
            var swagger2 = new PropertyApi
            {
                Type  = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.api"
            };

            singleApi2.Properties.Add(swagger2);

            exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi2);
            return(exceptedApisJsonForServerNoSecurity);
        }
Exemple #3
0
 public void testApnProperty()
 {
     try
     {
         // first arguemnt 'basePath' is optional
         PropertyApi propertyApi = new PropertyApi("http://demo2.onboardis.us");
         Label4.Text = propertyApi.Apn();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Exemple #4
0
        public void testAddressSummaryProperty()
        {
            String address = "1501 LAKEWOOD DR, WILMINGTON DE 19803"; // Address
            String filter  = "coolingType ne CENTRAL";                // Filter

            try
            {
                // first arguemnt 'basePath' is optional
                PropertyApi propertyApi = new PropertyApi("http://demo2.onboardis.us");
                Label30.Text = propertyApi.AddressSummary(address, filter);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #5
0
        SingleApi CreateSingleApiForResource(IResource resource, bool isPublic)
        {
            var webPath    = resource.GetResourcePath(GlobalConstants.ServerWorkspaceID).Replace("\\", "/");
            var accessPath = isPublic?"public/":"secure/";
            var singleApi  = new SingleApi
            {
                Name       = resource.ResourceName,
                BaseUrl    = EnvironmentVariables.PublicWebServerUri + accessPath + webPath + ".json",
                Properties = new List <PropertyApi>()
            };
            var propertyApi = new PropertyApi
            {
                Type  = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + accessPath + webPath + ".api"
            };

            singleApi.Properties.Add(propertyApi);
            return(singleApi);
        }
        public void SingleApi_SetProperties_AreEqual_ToPropertyValue_ExpertTrue()
        {
            //----------------------Arrange-----------------------
            var contactTest = new MaintainerApi()
            {
                Fn       = "TestName TestLastName",
                Email    = "*****@*****.**",
                Url      = "https://warewolf.io",
                Org      = "https://dev2.co.za",
                Adr      = "Bellevue, Kloof",
                Tel      = "7777",
                XTwitter = "@warewolf",
                XGithub  = "Warewolf-ESB/Warewolf",
                Photo    = "https://warewolf.io/testimages/logo.png",
                VCard    = "39A03A58-978F-4CFB-B1D1-3EFA6C55E380"
            };
            var contactList = new List <MaintainerApi>();

            contactList.Add(contactTest);

            var propertyApi = new PropertyApi()
            {
                Type  = "TestType",
                Value = EnvironmentVariables.PublicWebServerUri + "secure/Hello World.api",
            };
            var propertyApisList = new List <PropertyApi>();

            propertyApisList.Add(propertyApi);

            var baseUrl     = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.json";
            var description = "TestDiscription";
            var humanUrl    = "https://warewolf.io";
            var image       = "https://warewolf.io/testimages/logo.png";
            var name        = "TestName";
            var tags        = new List <string>();
            var version     = "1.0.1.1";
            //----------------------Assert------------------------
            var singleApi = new SingleApi()
            {
                BaseUrl     = baseUrl,
                Contact     = contactList,
                Description = description,
                HumanUrl    = humanUrl,
                Image       = image,
                Name        = name,
                Properties  = propertyApisList,
                Tags        = tags,
                Version     = version,
            };

            //----------------------Act---------------------------
            Assert.AreEqual(baseUrl, singleApi.BaseUrl);
            Assert.AreEqual(contactList, singleApi.Contact);
            Assert.AreEqual(description, singleApi.Description);
            Assert.AreEqual(humanUrl, singleApi.HumanUrl);
            Assert.AreEqual(image, singleApi.Image);
            Assert.AreEqual(name, singleApi.Name);
            Assert.AreEqual(propertyApisList, singleApi.Properties);
            Assert.AreEqual(tags, singleApi.Tags);
            Assert.AreEqual(version, singleApi.Version);
        }
Exemple #7
0
        SingleApi CreateSingleApiForResource(IResource resource,bool isPublic)
        {

            var webPath = resource.ResourcePath.Replace("\\","/");
            var accessPath = isPublic?"public/":"secure/";
            var singleApi = new SingleApi
            {
                Name = resource.ResourceName,
                BaseUrl = EnvironmentVariables.PublicWebServerUri + accessPath + webPath + ".json",
                Properties = new List<PropertyApi>()
            };
            var propertyApi = new PropertyApi
            {
                Type = "Swagger",
                Value = EnvironmentVariables.PublicWebServerUri + accessPath + webPath + ".api"
            };
            singleApi.Properties.Add(propertyApi);
            return singleApi;
        }
 static ApisJson GetExceptedApisJsonForServerPathWithNoSubDirectories()
 {
     var exceptedApisJsonForServerNoSecurity = new ApisJson
     {
         Name = EnvironmentVariables.PublicWebServerUri,
         Created = DateTime.Today.Date,
         Modified = DateTime.Today.Date,
         Description = "",
         Url = EnvironmentVariables.PublicWebServerUri + "Acceptance Testing Resources/Execution Engine/apis.json",
         SpecificationVersion = "0.15",
         Apis = new List<SingleApi>()
     };
     
     var singleApi2 = new SingleApi
     {
         Name = "Execution Engine Test",
         Description = "",
         BaseUrl = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.json",
         Properties = new List<PropertyApi>()
     };
     var swagger2 = new PropertyApi
     {
         Type = "Swagger",
         Value = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/Execution Engine/Execution Engine Test.api"
     };
     singleApi2.Properties.Add(swagger2);
     
     exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi2);
     return exceptedApisJsonForServerNoSecurity;
 }
 static ApisJson GetExceptedApisJsonForServerSecurity()
 {
     var exceptedApisJsonForServerNoSecurity = new ApisJson
     {
         Name = EnvironmentVariables.PublicWebServerUri,
         Created = DateTime.Today.Date,
         Modified = DateTime.Today.Date,
         Description = "",
         Url = EnvironmentVariables.PublicWebServerUri + "apis.json",
         SpecificationVersion = "0.15",
         Apis = new List<SingleApi>()
     };
     var singleApi1 = new SingleApi
     {
         Name = "Hello World",
         Description = "",
         BaseUrl = EnvironmentVariables.PublicWebServerUri + "secure/Hello World.json",
         Properties = new List<PropertyApi>()
     };
     var swagger1 = new PropertyApi
     {
         Type = "Swagger",
         Value = EnvironmentVariables.PublicWebServerUri + "secure/Hello World.api"
     };
     singleApi1.Properties.Add(swagger1);
     
     var singleApi3 = new SingleApi
     {
         Name = "9139Local",
         Description = "",
         BaseUrl = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/9139Local.json",
         Properties = new List<PropertyApi>()
     };
     var swagger3 = new PropertyApi
     {
         Type = "Swagger",
         Value = EnvironmentVariables.PublicWebServerUri + "secure/Acceptance Testing Resources/9139Local.api"
     };
     singleApi3.Properties.Add(swagger3);
     exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi1);
     exceptedApisJsonForServerNoSecurity.Apis.Add(singleApi3);
     return exceptedApisJsonForServerNoSecurity;
 }