示例#1
0
        public Object CreateObject()
        {
            Flattop flattop = new Flattop
            {
                engine = new Engine()
            };

            return(flattop);
        }
示例#2
0
        public void EqualReferences(List <BaseObject> list)
        {
            Flattop  flattop  = (Flattop)list[0];
            WarPlane warPlane = (WarPlane)list[1];
            Pilot    pilot    = (Pilot)list[2];

            Assert.AreSame(flattop.WarPlanes[0], warPlane);
            Assert.AreSame(warPlane.Pilot, pilot);
        }
示例#3
0
        public void EqualNullReferences(List <BaseObject> list)
        {
            Flattop  flattop  = (Flattop)list[0];
            WarPlane warPlane = (WarPlane)list[1];
            Pilot    pilot    = (Pilot)list[2];

            Assert.AreEqual(flattop.WarPlanes.Count, 0);
            Assert.AreEqual(warPlane.flattop, null);
            Assert.AreEqual(warPlane.Pilot, null);
        }
示例#4
0
 public void EqualFlattops(Flattop f1, Flattop f2)
 {
     Assert.AreEqual(f1.AmountRockets, f2.AmountRockets);
     Assert.AreEqual(f1.AmountSoldiers, f2.AmountSoldiers);
     Assert.AreEqual(f1.engine.Fuel, f2.engine.Fuel);
     Assert.AreEqual(f1.engine.Power, f2.engine.Power);
     Assert.AreEqual(f1.HomePort, f2.HomePort);
     Assert.AreEqual(f1.Identificator, f2.Identificator);
     Assert.AreEqual(f1.Model, f2.Model);
     Assert.AreEqual(f1.Ocean, f2.Ocean);
     Assert.AreEqual(f1.ReleaseYear, f2.ReleaseYear);
     Assert.AreEqual(f1.Speed, f2.Speed);
     //EqualWarPlanes(f1.WarPlanes[0], f2.WarPlanes[0]);
 }
示例#5
0
        public void InitializeThreeObjectsAndReferences(ApplicationDataContext applicationDataContext)
        {
            CreateFlattop(applicationDataContext, 20, 2000, "flattop", "zx-89", "123w", OceanType.Pacific, 156, 800, 8000, FuelType.Petrol);
            CreateWarPlane(applicationDataContext, 380, 2010, "warplane", "aw-5.2", 6, 8500, FuelType.Petrol);
            CreatePilot(applicationDataContext, 190, 86, "Aleksey", "Meresiev", 1987, 12, SkillLevelType.Level_3);

            WarPlane warPlane = (WarPlane)applicationDataContext.Objects[1];

            warPlane.Pilot = (Pilot)applicationDataContext.Objects[2];
            Flattop flattop = (Flattop)applicationDataContext.Objects[0];

            warPlane.flattop = (Flattop)applicationDataContext.Objects[0];
            flattop.WarPlanes.Add(warPlane);
        }
示例#6
0
    public void CreateFlattop(ApplicationDataContext applicationDataContext, int speed, int releaseYear, string model,
                              string identificator, string homePort, OceanType ocean, int amountRockets, int AmountSoldiers, int power, FuelType fuel)
    {
        BaseObject obj = new Flattop
        {
            Speed          = speed,
            ReleaseYear    = releaseYear,
            Model          = model,
            Identificator  = identificator,
            HomePort       = homePort,
            Ocean          = ocean,
            AmountRockets  = amountRockets,
            AmountSoldiers = AmountSoldiers,
            WarPlanes      = new List <WarPlane>(),
            engine         = new Engine()
            {
                Power = power,
                Fuel  = fuel,
            },
        };

        applicationDataContext.CallObjectCreatedEvent(applicationDataContext.Objects, obj);
    }