public static Entities.Models.Aeroplane ToModel(
     this Database.Context.Aeroplane entity
     )
 {
     return(new Entities.Models.Aeroplane()
     {
         Id = entity.Id,
         Capacity = entity.Capacity,
         TakeoffEffortPerOccupiedSeat = entity.TakeoffEffortPerOccupiedSeat,
         FuelConsumptionPerSeat = entity.FuelConsumptionPerSeat,
         Name = entity.Name
     });
 }
        public void AddAeroplane()
        {
            Database.Context.Aeroplane aeroplane = new Database.Context.Aeroplane()
            {
                Id       = 1,
                Name     = "cessna 172",
                Capacity = 4,
                FuelConsumptionPerSeat       = 10,
                MilesToCruisingAltitude      = 12,
                TakeoffEffortPerOccupiedSeat = 15
            };

            var result = Context.Aeroplanes.Add(aeroplane);

            Assert.IsTrue(result.State == EntityState.Added);

            Context.Database.EnsureDeleted();
        }
        public void GetAeroplane()
        {
            Database.Context.Aeroplane aeroplane = new Database.Context.Aeroplane()
            {
                Id       = 1,
                Name     = "cessna 172",
                Capacity = 4,
                FuelConsumptionPerSeat       = 10,
                MilesToCruisingAltitude      = 12,
                TakeoffEffortPerOccupiedSeat = 15
            };

            Context.Aeroplanes.Add(aeroplane);
            var result = Context.Aeroplanes.Find((long)1);

            Assert.IsTrue(aeroplane.Equals(result));

            Context.Database.EnsureDeleted();
        }