Пример #1
0
        private void UpdateCarSlim(CarSlim carSlim)
        {
            this.BeginTransaction();

            var repository = Repository.Create <ICarSlimRepository>();

            repository.Update(carSlim);

            this.Commit();
        }
Пример #2
0
        protected override void EnteredScene()
        {
            this.BeginTransaction();
            CarSlim carSlim = CreateCarSlim();

            var repository = Repository.Create <ICarSlimRepository>();

            repository.Add(carSlim);

            this.Commit();

            this.Fixture.Add(carSlim);
        }
Пример #3
0
        private CarSlim CreateCarSlim()
        {
            CarSlim carSlim = new CarSlim(Guid.NewGuid());

            carSlim.CarStyle     = CarStyle.SEDAN;
            carSlim.PartNum      = 128;
            carSlim.Stand        = 'B';
            carSlim.Comment      = 32600;
            carSlim.Name         = "宝马i7";
            carSlim.DeliveryDate = new Emptyable <DateTime>(new DateTime(2016, 5, 1));
            carSlim.OrderIndex   = 11;
            carSlim.Distance     = 3.56f;
            carSlim.Price        = 34.85m;
            carSlim.IsNewCar     = true;

            return(carSlim);
        }
Пример #4
0
        public void CarSlimTest5()
        {
            var carSlim = this.Fixture.Get <CarSlim>() as CarSlim;

            CheckCarSlimDataVersion(carSlim.Id, 1);
            carSlim.DeliveryDate = new Emptyable <DateTime>(new DateTime(2016, 7, 8));
            UpdateCarSlim(carSlim);

            var carSlimNew = FindCarSlim(carSlim.Id);

            Assert.AreEqual((DateTime)carSlimNew.DeliveryDate, new DateTime(2016, 7, 8));

            CarSlim carMemmory = GetCarSlim(carSlim.Id);

            Assert.AreEqual(carMemmory.DeliveryDate.GetType().ToString(), typeof(Emptyable <DateTime>).ToString());

            CheckCarSlimDataVersion(carSlim.Id, 2);
        }