Exemplo n.º 1
0
        public void FirstCompanyShouldBeDifferentThanSecondCompanyTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var firstCompany  = conn.Table <AirlineCompany>("SCARR").Take(1).ReadOne();
                var secondCompany = conn.Table <AirlineCompany>("SCARR").Skip(1).Take(1).ReadOne();

                Assert.NotEqual(firstCompany.Code, secondCompany.Code);
            }
        }
Exemplo n.º 2
0
 public void ReadAllEntriesTest()
 {
     using (SapRfcConnection conn = this.GetConnection())
     {
         var scarr = conn.Table <AirlineCompany>("SCARR").Read();
         Assert.Equal(18, scarr.Count());
     }
 }
Exemplo n.º 3
0
 public void TakeFirstCompanyTest()
 {
     using (SapRfcConnection conn = this.GetConnection())
     {
         var scarr = conn.Table <AirlineCompany>("SCARR").Take(1).Read();
         Assert.Equal(1, scarr.Count());
     }
 }
Exemplo n.º 4
0
        public void StrongTypeGreaterEqualAndLessEqualThanConditionTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var flights = conn.Table <Flight>("SPFLI")
                              .Where("DISTANCE", RfcReadTableOption.GreaterOrEqualThan, 6030)
                              .And("DISTANCE", RfcReadTableOption.LessOrEqualThan, 9100)
                              .Read();

                Assert.Equal(12, flights.Count());
            }
        }
Exemplo n.º 5
0
        public void ReadWithTwoOrConditionsTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var scarr = conn.Table <AirlineCompany>("SCARR")
                            .Select("CARRID", "CURRCODE")
                            .Where("CARRID = 'DL'")
                            .Or("CARRID = 'AA'")
                            .Read();

                Assert.Equal(2, scarr.Count());
            }
        }
Exemplo n.º 6
0
        public void ReadTwoFieldsTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var scarr = conn.Table <AirlineCompany>("SCARR").Select("CARRID", "CARRNAME").Read();
                Assert.Equal(18, scarr.Count());

                var aa = scarr.FirstOrDefault(x => x.Code == "AA");
                Assert.Equal("AA", aa.Code);
                Assert.Equal("American Airlines", aa.Name);
                Assert.Equal(null, aa.Currency);
                Assert.Equal(null, aa.Url);
            }
        }
Exemplo n.º 7
0
        public void StrongTypeNotEqualsConditionTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var scarr = conn.Table <AirlineCompany>("SCARR")
                            .Select("CARRID", "CURRCODE")
                            .Where("CARRID", RfcReadTableOption.NotEquals, "DL")
                            .Read();

                foreach (var company in scarr)
                {
                    Assert.NotEqual("DL", company.Code);
                }
            }
        }
Exemplo n.º 8
0
        public void StrongTypeEqualsConditionTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var scarr = conn.Table <AirlineCompany>("SCARR")
                            .Select("CARRID", "CURRCODE")
                            .Where("CARRID", RfcReadTableOption.Equals, "DL")
                            .Read();

                Assert.Equal(1, scarr.Count());
                Assert.Equal("DL", scarr.ElementAt(0).Code);
                Assert.Equal("USD", scarr.ElementAt(0).Currency);

                Assert.Equal(null, scarr.ElementAt(0).Name);
                Assert.Equal(null, scarr.ElementAt(0).Url);
                Assert.Equal(0, scarr.ElementAt(0).Client);
            }
        }
Exemplo n.º 9
0
        public void ReadTwoFieldFromDeltaAirlineCompanyTest()
        {
            using (SapRfcConnection conn = this.GetConnection())
            {
                var scarr = conn.Table <AirlineCompany>("SCARR")
                            .Select("CARRID", "CURRCODE")
                            .Where("CARRID = 'DL'")
                            .Read();

                Assert.Equal(1, scarr.Count());
                Assert.Equal("DL", scarr.ElementAt(0).Code);
                Assert.Equal("USD", scarr.ElementAt(0).Currency);

                Assert.Equal(null, scarr.ElementAt(0).Name);
                Assert.Equal(null, scarr.ElementAt(0).Url);
                Assert.Equal(0, scarr.ElementAt(0).Client);
            }
        }