コード例 #1
0
        public void TestInstanceConnectorExecute()
        {
            var component   = new AirportInfoComponent();
            var channelName = component.Channels.First().Name;
            var results     = component.Execute(channelName, "JFK", "LAX", "ORD");

            Assert.IsInstanceOf <List <object> >(results);
        }
コード例 #2
0
        public void TestGenericExecuteHelper()
        {
            // Arrange
            const string iata = "LAX";

            // Act
            var airportInfo = AirportInfoComponent.Execute <AirportInfo>(iata);
            var state       = airportInfo.State;

            // Assert
            Assert.AreEqual("California", state);
        }
コード例 #3
0
        public void TestStaticHelper()
        {
            // Arrange
            const string iata = "JFK";

            // Act
            var info = AirportInfoComponent.Execute(iata);

            // Assert
            Assert.NotNull(info);
            Assert.IsInstanceOf(typeof(string), info);
        }
コード例 #4
0
ファイル: Sample.cs プロジェクト: tweakch/PdcFramework
        private static void Main(string[] args)
        {
            // receive raw airport data
            var info = AirportInfoComponent.Execute("JFK");
            // {"delay":"true","IATA":"JFK"...

            // directly map results to your classes
            var delay = AirportInfoComponent.Execute <AirportInfo>("JFK").Delay;
            // true

            // string components together
            var sequence = PipeConnector.CreateSequence <AirportInfoComponent, UnaryAbbreviationExtenderComponent>();
            var example  = sequence.Execute("JFK");
            // example = {"delay":"true","internationalAirTransportAssociation":"John Fitzgerald Kennedy...

            var username  = "******";
            var password  = "******";
            var sessionId = GeoNamesPostalCodesComponent.Login(username, password);
            var result    = (string)GeoNamesPostalCodesComponent.PostalCode(username, sessionId, "8001");

            var geo = result.ToInstance <GeoInfo>();
        }