• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Expedia.Car类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Expedia.Car的典型用法代码示例。如果您正苦于以下问题:C# Car类的具体用法?C# Car怎么用?C# Car使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Car类属于Expedia命名空间,在下文中一共展示了Car类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TestThatCarDoesGetLocationFromTheDatabase

        public void TestThatCarDoesGetLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            String carLocation = "On a whale";
            String anotherCarLocation = "On a raptor ranch";

            using (mocks.Record())
            {
                // The mock will return "On a whale" when the call is made with 24
                mockDatabase.getCarLocation(24);
                LastCall.Return(carLocation);
                // The mock will return "Raptor Wrangler" when the call is made with 1025
                mockDatabase.getCarLocation(1025);
                LastCall.Return(anotherCarLocation);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(1025);
            Assert.AreEqual(result, anotherCarLocation);

            result = target.getCarLocation(24);
            Assert.AreEqual(result, carLocation);
        }
开发者ID:veatchje,项目名称:Lab4-veatchje,代码行数:27,代码来源:CarTest.cs


示例2: TestThatCarDoesGetLocationFromTheDatabase

        public void TestThatCarDoesGetLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            String carLocation = "My Garage";
            String anotherCarLocation = "Stelvio Pass";

            using (mocks.Record())
            {
                // The mock will return "My Garage" when the call is made with 15
                mockDatabase.getCarLocation(15);
                LastCall.Return(carLocation);

                // The mock will return "Stelvio Pass" when the call is made with 23
                mockDatabase.getCarLocation(23);
                LastCall.Return(anotherCarLocation);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(15);
            Assert.AreEqual(result, carLocation);

            result = target.getCarLocation(23);
            Assert.AreEqual(result, anotherCarLocation);
        }
开发者ID:pohltm,项目名称:Lab4-pohltm,代码行数:28,代码来源:CarTest.cs


示例3: TestThatCarGetsLocationFromDatabase

        public void TestThatCarGetsLocationFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String firstLocation = "Terre Haute";
            String otherLocation = "Spaaaaace!";

            using(mocks.Record())
            {
                mockDatabase.getCarLocation(15);
                LastCall.Return(firstLocation);

                mockDatabase.getCarLocation(311);
                LastCall.Return(otherLocation);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(311);
            Assert.AreEqual(result, otherLocation);

            result = target.getCarLocation(15);
            Assert.AreEqual(result, firstLocation);
        }
开发者ID:SoggyNoose,项目名称:Lab4-kimsj,代码行数:27,代码来源:CarTest.cs


示例4: TestThatCarDoesGetCarLocationFromTheDatabase

        public void TestThatCarDoesGetCarLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            int car1 = 10;
            String car1Location = "Hawaii";

            int car2 = 50;
            String car2Location = "Indiana";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(car1);
                LastCall.Return(car1Location);

                mockDatabase.getCarLocation(car2);
                LastCall.Return(car2Location);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;
            result = target.getCarLocation(10);
            Assert.AreEqual(result, car1Location);

            result = target.getCarLocation(50);
            Assert.AreEqual(result, car2Location);
        }
开发者ID:HawaiianNinja,项目名称:Lab4-hopkinaj,代码行数:28,代码来源:CarTest.cs


示例5: TestThatCarDoesGetCarLocationFromTheDatabase

        public void TestThatCarDoesGetCarLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String carLocation = "there";
            String anotherCarLocation = "everywhere";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(17);
                LastCall.Return(carLocation);
                mockDatabase.getCarLocation(5);
                LastCall.Return(anotherCarLocation);
            }
            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(5);
            Assert.AreEqual(result, anotherCarLocation);

            result = target.getCarLocation(17);
            Assert.AreEqual(result, carLocation);
        }
开发者ID:floytesangen,项目名称:Lab4-lapresga,代码行数:25,代码来源:CarTest.cs


示例6: TestThatCarCanGetCarLocationFromTheDatabase

        public void TestThatCarCanGetCarLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String carLocation1337 = "Home";
            String carLocation1024 = "Mars";

            using(mocks.Record())
            {
                // The mock will return "Mars" when the call is made with 1024
                mockDatabase.getCarLocation(1024);
                LastCall.Return(carLocation1024);

                // The mock will return "Home" when the call is made with 1337
                mockDatabase.getCarLocation(1337);
                LastCall.Return(carLocation1337);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(1337);
            Assert.AreEqual(result, carLocation1337);

            result = target.getCarLocation(1024);
            Assert.AreEqual(result, carLocation1024);
        }
开发者ID:punpun1000,项目名称:Lab4-mercermt,代码行数:29,代码来源:CarTest.cs


示例7: TestThatCarDoesGetCarLocationFromDatabase

        public void TestThatCarDoesGetCarLocationFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String location1 = "Lot A";
            String location2 = "Lot C";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(5);
                LastCall.Return(location1);

                mockDatabase.getCarLocation(10);
                LastCall.Return(location2);
            }

            var target = new Car(5);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(5);
            Assert.AreEqual(result, location1);

            result = target.getCarLocation(10);
            Assert.AreEqual(result, location2);
        }
开发者ID:westeras,项目名称:Lab4-westeras,代码行数:27,代码来源:CarTest.cs


示例8: TestThatCarDoesGetLocationFromTheDatabase

        public void TestThatCarDoesGetLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String car = "Beetle";
            String truck = "Wat";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(1);
                LastCall.Return(car);

                mockDatabase.getCarLocation(2);
                LastCall.Return(truck);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result = target.getCarLocation(1);
            Assert.AreEqual(result, car);

            result = target.getCarLocation(2);
            Assert.AreEqual(result, truck);
        }
开发者ID:ycdfn,项目名称:Lab4-michaeaj,代码行数:25,代码来源:CarTest.cs


示例9: TestCarLocation

        public void TestCarLocation()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String car1 = "Here";
            String car2 = "There";
            using (mocks.Record())
            {
                mockDatabase.getCarLocation(5);
                LastCall.Return(car1);

                mockDatabase.getCarLocation(8);
                LastCall.Return(car2);
            }

            var target = new Car(5);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(5);
            Assert.AreEqual(result, car1);

            result = target.getCarLocation(8);
            Assert.AreEqual(result, car2);
        }
开发者ID:banksda,项目名称:Lab4-banksda,代码行数:26,代码来源:CarTest.cs


示例10: TestThatCarDoesGetLocationFromTheDatabase

        public void TestThatCarDoesGetLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            String carLocation = "Parking lot A53, row 6, next to the rabid squirrels' nest";
            String anotherCarLocation = "Forever lost";
            using (mocks.Record())
            {
                // The mock will return "Whale Rider" when the call is made with 24
                mockDatabase.getCarLocation(24);
                LastCall.Return(carLocation);
                // The mock will return "Raptor Wrangler" when the call is made with 1025
                mockDatabase.getCarLocation(1025);
                LastCall.Return(anotherCarLocation);
            }
            var target = new Car(10);
            target.Database = mockDatabase;

            String result;

            result = target.getCarLocation(1025);
            Assert.AreEqual(result, anotherCarLocation);

            result = target.getCarLocation(24);
            Assert.AreEqual(result, carLocation);
        }
开发者ID:KimberlyBoucher,项目名称:Lab2-boucheka,代码行数:25,代码来源:CarTest.cs


示例11: TestThatCarDoesGetMileageFromTheDatabase

        public void TestThatCarDoesGetMileageFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            String ZeroMileage = "Zero mileage, you're going nowhere";
            String NegativeMileage = "Neagive mileage, you're going backwards";
            String PositiveMileage = "Positive Mileage, you're doing it right";

            using (mocks.Record())
            {

                mockDatabase.getCarLocation(0);
                LastCall.Return(ZeroMileage);

                mockDatabase.getCarLocation(-45);
                LastCall.Return(NegativeMileage);

                mockDatabase.getCarLocation(80);
                LastCall.Return(PositiveMileage);
            }

            var target = new Car(10);

            target.Database = mockDatabase;

            String result;
            result = target.getCarLocation(0);
            Assert.AreEqual(result, ZeroMileage);
            result = target.getCarLocation(-45);
            Assert.AreEqual(result, NegativeMileage);
            result = target.getCarLocation(80);
            Assert.AreEqual(result, PositiveMileage);
        }
开发者ID:galvezdm,项目名称:Lab4-galvezdm,代码行数:32,代码来源:CarTest.cs


示例12: TestGetCorrectCarLocationFromDatabase

        public void TestGetCorrectCarLocationFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            String location1 = "Terre Haute, Indiana";
            String location2 = "Morristown, Indiana";

            using (mocks.Record())
            {
                // The mock will return "Terre Haute, Indiana" when the call is made with 1
                mockDatabase.getCarLocation(1);
                LastCall.Return(location1);
                // The mock will return "Morristown, Indiana" when the call is made with 2
                mockDatabase.getCarLocation(2);
                LastCall.Return(location2);
            }

            var target = new Car(10);
            target.Database = mockDatabase;

            String result;
            result = target.getCarLocation(1);
            Assert.AreEqual(result, location1);
            result = target.getCarLocation(2);
            Assert.AreEqual(result, location2);
        }
开发者ID:sheltotj,项目名称:Lab4-sheltotj,代码行数:26,代码来源:CarTest.cs


示例13: TestThatCarDoesGetCarLocationFromTheDatabase

        public void TestThatCarDoesGetCarLocationFromTheDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();
            int carNumber1 = 34;
            int carNumber2 = 55;
            String carLocation1 = "1397B";
            String carLocation2 = "1678D";
            int daysToRent = 10;

            using(mocks.Record())
            {
              mockDatabase.getCarLocation(carNumber1);
              LastCall.Return(carLocation1);

              mockDatabase.getCarLocation(carNumber2);
              LastCall.Return(carLocation2);
            }

            var target = new Car(daysToRent);
            target.Database = mockDatabase;

            String result;
            result = target.getCarLocation(carNumber2);
            Assert.AreEqual(carLocation2, result);

            result = target.getCarLocation(carNumber1);
            Assert.AreEqual(carLocation1,result);
        }
开发者ID:zhengc,项目名称:Lab4-zhengc,代码行数:28,代码来源:CarTest.cs


示例14: TestFlightEqualsHotel

 public void TestFlightEqualsHotel()
 {
     DateTime StartDate = new DateTime(2009, 11, 1);
     DateTime EndDate = new DateTime(2009, 11, 1);
     var target = new Flight(StartDate, EndDate, 700);
     var target2 = new Car(5);
     Assert.False(target.Equals(target2));
 }
开发者ID:KimberlyBoucher,项目名称:Lab2-boucheka,代码行数:8,代码来源:FlightTest.cs


示例15: TestgetCarLocation

 public void TestgetCarLocation()
 {
     IDatabase mockDatabase = mocks.Stub<IDatabase>();
     var target = new Car(3);
     target.Database = mockDatabase;
     String carLocation = target.getCarLocation(15);
     Assert.AreEqual(carLocation, mockDatabase.getCarLocation(15));
 }
开发者ID:spurrme,项目名称:Lab4-spurrme,代码行数:8,代码来源:CarTest.cs


示例16: TestThatCarCanGetMileageFromDatabase

        public void TestThatCarCanGetMileageFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            mockDatabase.Miles = 500;
            var target = new Car(10);
            target.Database = mockDatabase;
            Assert.AreEqual(target.Mileage, 500);
        }
开发者ID:seanjohn,项目名称:Lab4-cavanasm,代码行数:9,代码来源:CarTest.cs


示例17: TestThatCarCanGetLocation

        public void TestThatCarCanGetLocation()
        {
            IDatabase mockDatabase = mocks.Stub<IDatabase>();

            var target = new Car(10);
            target.Database = mockDatabase;
            String carLoc = target.getCarLocation(1);
            Assert.AreEqual(carLoc, mockDatabase.getCarLocation(1));
        }
开发者ID:Feroxmrbrick,项目名称:Lab4-frankmp,代码行数:9,代码来源:CarTest.cs


示例18: TestThatCarDoesGetMillageFromDatabase

 public void TestThatCarDoesGetMillageFromDatabase()
 {
     IDatabase mockDatabase = mocks.Stub<IDatabase>();
     mockDatabase.Miles = 2000;
     var target = new Car(10);
     target.Database = mockDatabase;
     int milesTravled = target.Mileage;
     Assert.AreEqual(2000, milesTravled);
 }
开发者ID:HawaiianNinja,项目名称:Lab4-hopkinaj,代码行数:9,代码来源:CarTest.cs


示例19: TestThatCarGetsDatabaseMileage

 public void TestThatCarGetsDatabaseMileage()
 {
     IDatabase mockDatabase = mocks.Stub<IDatabase>();
     int Miles = 3000;
     mockDatabase.Miles = Miles;
     var target = new Car(10);
     target.Database = mockDatabase;
     int mileCount = target.Mileage;
     Assert.AreEqual(mileCount, Miles);
 }
开发者ID:pedzindm,项目名称:Lab4-pedzindm,代码行数:10,代码来源:CarTest.cs


示例20: TestThatCarDoesGetMileageCountFromDatabase

 public void TestThatCarDoesGetMileageCountFromDatabase()
 {
     IDatabase mockDatabase = mocks.Stub<IDatabase>();
     int Miles = 150;
     mockDatabase.Miles = Miles;
     var target = new Car(10);
     target.Database = mockDatabase;
     int Mileage = target.Mileage;
     Assert.AreEqual(Mileage, Miles);
 }
开发者ID:KimberlyBoucher,项目名称:Lab2-boucheka,代码行数:10,代码来源:CarTest.cs



注:本文中的Expedia.Car类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Expedia.Flight类代码示例发布时间:2022-05-24
下一篇:
C# Photon.Hashtable类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap