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

C# Expedia.User类代码示例

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

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



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

示例1: TestThatUserHasFrequentFlierMilesAfterBooking2

 public void TestThatUserHasFrequentFlierMilesAfterBooking2()
 {
     var target = new User("Bob Dole");
     target.book(new Flight(StartDate, EndDate, 1), new Hotel(5), new Car(3));
     Assert.Less(0, target.FrequentFlierMiles);
     Assert.AreEqual(3, target.Bookings.Count);
 }
开发者ID:ilovllamas12,项目名称:Lab3-crouchjt,代码行数:7,代码来源:UserTest.cs


示例2: TestThatHotelNotEqualToNonHotel

        public void TestThatHotelNotEqualToNonHotel()
        {
            var hot1 = new Hotel(4);
            var notHotel = new User("I'm not a hotel");

            Assert.False(hot1.Equals(notHotel));
        }
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:7,代码来源:HotelTest.cs


示例3: TestThatUserDoesRemoveCarFromServiceLocatorWhenBooked

 public void TestThatUserDoesRemoveCarFromServiceLocatorWhenBooked()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var carToBook = new Car(5);
     var remainingCar = new Car(7);
     serviceLocator.AddCar(carToBook);
     serviceLocator.AddCar(remainingCar);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(carToBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableCars.Count);
     Assert.AreSame(remainingCar, ServiceLocator.Instance.AvailableCars[0]);
 }
开发者ID:almajeas,项目名称:Lab4-almajeas,代码行数:13,代码来源:UserTest.cs


示例4: TestThatUserDoesRemovveFlightFromServiceLocatorWhenBooked

 public void TestThatUserDoesRemovveFlightFromServiceLocatorWhenBooked()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var flightToBook = new Flight(new DateTime(2009, 11, 1), new DateTime(2009, 11, 30), 750);
     var remainingFlight = new Flight(new DateTime(2009, 11, 2), new DateTime(2009, 11, 28), 500);
     serviceLocator.AddFlight(flightToBook);
     serviceLocator.AddFlight(remainingFlight);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(flightToBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
     Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
 }
开发者ID:KimberlyBoucher,项目名称:Lab2-boucheka,代码行数:13,代码来源:UserTest.cs


示例5: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

 public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var flightToBook = new Flight(DateTime.Now, DateTime.Now.AddDays(5), 0);
     var otherFlight = new Flight(DateTime.Now, DateTime.Now.AddDays(10), 0);
     serviceLocator.AddFlight(flightToBook);
     serviceLocator.AddFlight(otherFlight);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
     .SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(flightToBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
     Assert.AreSame(otherFlight, ServiceLocator.Instance.AvailableFlights[0]);
 }
开发者ID:HawaiianNinja,项目名称:Lab4-hopkinaj,代码行数:14,代码来源:UserTest.cs


示例6: TestThatFlightIsRemovedFromServiceLocator

 public void TestThatFlightIsRemovedFromServiceLocator()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var flightToBook = ObjectMother.FlightToChicago();
     var remainingFlight = ObjectMother.FlightToChicago();
     serviceLocator = new ServiceLocator();
     serviceLocator.AddFlight(flightToBook);
     serviceLocator.AddFlight(remainingFlight);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
     .SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(flightToBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
     Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
 }
开发者ID:stamptd,项目名称:Lab4-stamptd,代码行数:15,代码来源:UserTest.cs


示例7: TestThatUserDoesRemoveFlightFromSerivceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromSerivceLocatorWhenBooked()
        {
            ServiceLocator serviceloc = new ServiceLocator();
            var flightToBook = new Flight(new DateTime(2009, 11, 1), new DateTime(2009, 11, 30), 100);
            var remainingFlight = new Flight(new DateTime(2009, 12, 1), new DateTime(2009, 12, 30), 1000);
            serviceloc.AddFlight(flightToBook);
            serviceloc.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(serviceloc, serviceloc);

            var target = new User("Bobby");
            target.book(flightToBook);

            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:eatonmi,项目名称:Lab4-eatonmi,代码行数:16,代码来源:UserTest.cs


示例8: TestThatServiceLocatorRemovesFlightWhenBooked

        public void TestThatServiceLocatorRemovesFlightWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            var flightToBook = new Flight(new DateTime(2000, 01, 01), new DateTime(2000, 01, 07), 5);
            var remainingFlight = new Flight(new DateTime(2000,01,01), new DateTime(2000,01,07), 6);
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
            .SetValue(serviceLocator, serviceLocator);

            var target = new User("Jimbo");
            target.book(flightToBook);
            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:cooperra,项目名称:Lab4-cooperra,代码行数:16,代码来源:UserTest.cs


示例9: ServiceLocator

        public void TestThatUserDoesRemoveFlightsWhichAreBookedFromListOfAvailableFlightsInServiceLocatorSinceBookedFlightsHaveNoMoreRoomOnThemForOtherPeopleToBuyTicketsToFlyOnThem()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            var flightToBook = new Flight(new DateTime(2011, 4, 15), new DateTime(2011, 4, 20), 1000);
            var remainingFlight = new Flight(new DateTime(2011, 4, 5), new DateTime(2011, 4, 10), 1000);
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Bob");
            target.book(flightToBook);

            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:davidov541,项目名称:Lab4-mcginnda,代码行数:16,代码来源:UserTest.cs


示例10: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            var flightToBook = new Flight(DateTime.Now, DateTime.Now.AddDays(5), 1000);
            var remainingFlight1 = new Flight(DateTime.Now.AddDays(2), DateTime.Now.AddDays(15), 1300);
            var remainingFlight2 = new Flight(DateTime.Now.AddDays(5), DateTime.Now.AddDays(18), 700);
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight1);
            serviceLocator.AddFlight(remainingFlight2);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Shawn");
            target.book(flightToBook);

            Assert.AreEqual(2, ServiceLocator.Instance.AvailableFlights.Count);
              			Assert.AreSame(remainingFlight1, ServiceLocator.Instance.AvailableFlights[0]);
            Assert.AreSame(remainingFlight2, ServiceLocator.Instance.AvailableFlights[1]);
        }
开发者ID:zhengc,项目名称:Lab4-zhengc,代码行数:19,代码来源:UserTest.cs


示例11: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            DateTime startDate1 = new DateTime(2012, 11, 1);
            DateTime endDate1 = new DateTime(2012, 11, 4);

            DateTime startDate2 = new DateTime(2013, 5, 12);
            DateTime endDate2 = new DateTime(2013, 5, 28);

            var flightToBook = new Flight(startDate1, endDate1, 5000);
            var remainingFlight= new Flight(startDate2, endDate2, 8000);
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Bob");
            target.book(flightToBook);

            Assert.AreEqual(serviceLocator.AvailableFlights.Count, 1);
            Assert.AreSame(remainingFlight, serviceLocator.AvailableFlights[0]);
        }
开发者ID:drakecb,项目名称:Lab4-drakecb,代码行数:22,代码来源:UserTest.cs


示例12: TestThatTwoFlightsNotEqual

        public void TestThatTwoFlightsNotEqual()
        {
            var start = new DateTime(1999, 1, 1);
            var end = new DateTime(1999, 1, 2);
            int miles = 100;
            var flight = new Flight(start, end, miles);

            //var start1 = new DateTime(1999, 1, 1);
            //var end1 = new DateTime(1999, 1, 4);
            //int miles1 = 200;
            var notFlight = new User("NotAFlight");

            Assert.False(flight.Equals(notFlight));
        }
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:14,代码来源:FlightTest.cs


示例13: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

 public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var flighttoBook = new Flight(StartDate, EndDate, 12);
     var flightRemaining = new Flight(StartDate, new DateTime(2010, 12, 12), 16);
     serviceLocator.AddFlight(flighttoBook);
     serviceLocator.AddFlight(flightRemaining);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
     .SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(flighttoBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
     Assert.AreSame(flightRemaining, ServiceLocator.Instance.AvailableFlights[0]);
 }
开发者ID:mellinja,项目名称:Lab4-mellinja,代码行数:14,代码来源:FlightTest.cs


示例14: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();

            var flightToBook = ObjectMother.CoupleOfDaysFlight();
            var remainingFlight = ObjectMother.LotsOfDaysFlight();
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Alice");
            target.book(flightToBook);

            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:balthacv,项目名称:Lab4-balthacv,代码行数:17,代码来源:UserTest.cs


示例15: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            DateTime startDate = new DateTime();
            DateTime endDate = startDate;

            var flightToBook = new Flight(startDate, endDate, 10);
            var remainingFlight = new Flight(startDate, endDate, 10);

            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Bro");
            target.book(flightToBook);

            var availableFlights = ServiceLocator.Instance.AvailableFlights.Count;
            var flightRemaining = ServiceLocator.Instance.AvailableFlights[0];

            Assert.AreEqual(availableFlights, 1);
            Assert.AreSame(flightRemaining, remainingFlight);
        }
开发者ID:ycdfn,项目名称:Lab4-michaeaj,代码行数:23,代码来源:UserTest.cs


示例16: TestThatUserDoesRemoveCarFromServiceLocatorWhenBooked

 public void TestThatUserDoesRemoveCarFromServiceLocatorWhenBooked()
 {
     ServiceLocator serviceLocator = new ServiceLocator();
     var FlightToBook = new Flight(System.DateTime.MinValue, System.DateTime.MaxValue, 20);
     var remainingFlight = new Flight(System.DateTime.MinValue, System.DateTime.MaxValue, 15);
     serviceLocator.AddFlight(FlightToBook);
     serviceLocator.AddFlight(remainingFlight);
     typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
     .SetValue(serviceLocator, serviceLocator);
     var target = new User("Bob");
     target.book(FlightToBook);
     Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
     Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
 }
开发者ID:baroba,项目名称:Lab4-baroba,代码行数:14,代码来源:FlightTest.cs


示例17: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            System.DateTime arrive = new System.DateTime(13, 12, 10);
            System.DateTime depart = new System.DateTime(13, 12, 14);
            ServiceLocator serviceLocator = new ServiceLocator();
            var flightToBook = new Flight(arrive, depart, 4);
            var remainingFlight = new Flight(new System.DateTime(14, 11, 19),new System.DateTime(14, 11, 24),50);

            serviceLocator.AddFlight(flightToBook);
            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)
                .SetValue(serviceLocator, serviceLocator);
            serviceLocator.AddFlight(remainingFlight);
            var target = new User("Bob");
            target.book(flightToBook);

            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:schepedw,项目名称:Lab4-schepedw,代码行数:18,代码来源:UserTest.cs


示例18: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            DateTime StartDate = new DateTime(2009, 11, 1);
            DateTime EndDate = new DateTime(2009, 11, 30);
            DateTime StartDate2 = new DateTime(2009, 5, 1);
            DateTime EndDate2 = new DateTime(2009, 5, 21);
            ServiceLocator serviceLocator = new ServiceLocator();
            var flightToBook = new Flight(StartDate, EndDate, 500);
            var remainingFlight = new Flight(StartDate2, EndDate2, 200);

            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Tom");
            target.book(flightToBook);

            Assert.AreEqual(serviceLocator.AvailableFlights.Count, 1);
            Assert.AreSame(serviceLocator.AvailableFlights[0], remainingFlight);
        }
开发者ID:applekw,项目名称:Lab4-applekw,代码行数:21,代码来源:UserTest.cs


示例19: Setup

 public void Setup()
 {
     target = new User("Bob Dole");
 }
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:4,代码来源:UserTest.cs


示例20: TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked

        public void TestThatUserDoesRemoveFlightFromServiceLocatorWhenBooked()
        {
            ServiceLocator serviceLocator = new ServiceLocator();
            DateTime startDateForFirstFlight = new DateTime(2012, 03, 26);
            DateTime endDateForFirstFlight = new DateTime(2012, 05, 30);
            int milesForFirstFlight = 900;
            DateTime startDateForSecondFlight = new DateTime(2012, 07, 01);
            DateTime endDateForSecondFlight = new DateTime(2012, 07, 05);
            int milesForSecondFlight = 510;
            var flightToBook = new Flight(startDateForFirstFlight, endDateForFirstFlight, milesForFirstFlight);
            var remainingFlight = new Flight(startDateForSecondFlight, endDateForSecondFlight, milesForSecondFlight);
            serviceLocator.AddFlight(flightToBook);
            serviceLocator.AddFlight(remainingFlight);

            typeof(ServiceLocator).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).SetValue(serviceLocator, serviceLocator);

            var target = new User("Sriram");
            target.book(flightToBook);

            Assert.AreEqual(1, ServiceLocator.Instance.AvailableFlights.Count);
            Assert.AreSame(remainingFlight, ServiceLocator.Instance.AvailableFlights[0]);
        }
开发者ID:ehines,项目名称:Lab4-hinesen,代码行数:22,代码来源:UserTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Ext.Ext类代码示例发布时间:2022-05-24
下一篇:
C# Expedia.Hotel类代码示例发布时间: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