示例#1
0
 public ReservationServiceTests(ServiceTestFixture serviceTestFixture)
     : base(serviceTestFixture)
 {
     _target      = new ReservationService.ReservationServiceClient(Channel);
     _autoClient  = new AutoService.AutoServiceClient(Channel);
     _kundeClient = new KundeService.KundeServiceClient(Channel);
 }
        public void ChangeReservation(List<PreorderTable> tableList)
        {
            using (ReservationService.ReservationServiceClient proxy = new ReservationService.ReservationServiceClient())
            {
                try
                {
                    proxy.Open();
                    foreach (PreorderTable table in tableList)
                    {
                        proxy.ChangeReservation(table);
                    }

                }
                catch (FaultException<HCSMSException> ex)
                {
                    raiseError(ex);
                }
                catch (Exception ex)
                {
                    raiseError(ex);
                }
                finally
                {
                    proxy.Close();
                }
            }
        }
        public ReservationServiceTests(ServiceTestFixture serviceTestFixture, ITestOutputHelper testOutputHelper)
            : base(serviceTestFixture)
        {
            _testOutputHelper = testOutputHelper;
            _target           = new ReservationService.ReservationServiceClient(Channel);
            _autoClient       = new AutoService.AutoServiceClient(Channel);
            _kundeClient      = new KundeService.KundeServiceClient(Channel);
            int year = DateTime.Now.Year + 1;

            _von = Timestamp.FromDateTime(DateTime.SpecifyKind(new DateTime(year, 01, 10), DateTimeKind.Utc));
            _bis = Timestamp.FromDateTime(DateTime.SpecifyKind(new DateTime(year, 01, 20), DateTimeKind.Utc));
        }
        public List<PreorderTable> GetReservation()
        {
            using (ReservationService.ReservationServiceClient proxy = new ReservationService.ReservationServiceClient())
            {
                try
                {
                    proxy.Open();

                    return proxy.GetReservationList().ToList();

                }
                catch (FaultException<HCSMSException> ex)
                {
                    raiseError(ex);
                    return null;
                }
                catch (Exception ex)
                {
                    raiseError(ex);
                    return null;
                }
                finally
                {
                    proxy.Close();
                }
            }
        }