public void TestBasicReisAddGetUpdateDelete()
        {
            //Add-Get-Тест
            DateTime date = DateTime.Now;
            BasicReis expectedBasicReis = new BasicReis();
            expectedBasicReis.Date = date;

            AccessToBasicReis basicReis = new AccessToBasicReis();
            basicReis.AddElement(expectedBasicReis);
            var actualBasicReis = basicReis.GetAll().Last();
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Update - Тест
            expectedBasicReis = actualBasicReis;
            expectedBasicReis.Date = date.AddDays(2);
            basicReis.UpdateElement(expectedBasicReis);
            actualBasicReis = basicReis.GetElement(expectedBasicReis.CodeBasicReis);
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Delete-Тест
            int expectedCount = basicReis.GetAll().Count() - 1;
            basicReis.DeleteElement(actualBasicReis);
            int actualCount = basicReis.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }
Пример #2
0
        public static void Complete(ref AccessToBasicReis Reis, ref AccessToPlanes Planes)
        {
            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 20;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 40;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 55;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 25;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 40;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 15;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 10;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 25;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }
            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 1500;
                el.Interval  = 16;
                el.To        = "Bangkok";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }

            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 1000;
                el.Interval  = 10;
                el.To        = "Vladivostok";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 2000;
                el.Interval  = 15;
                el.To        = "Indonezia";
                el.CodePlain = 3;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 3000;
                el.Interval  = 14;
                el.To        = "Florida";
                el.CodePlain = 4;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 1000;
                el.Interval  = 5;
                el.To        = "Minsk";
                el.CodePlain = 5;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 2000;
                el.Interval  = 12;
                el.To        = "NewYork";
                el.CodePlain = 6;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 4500;
                el.Interval  = 10;
                el.To        = "Belen";
                el.CodePlain = 7;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 3000;
                el.Interval  = 5;
                el.To        = "Natal";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 1500;
                el.Interval  = 8;
                el.To        = "Terezina";
                el.CodePlain = 9;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date      = DateTime.Parse("2010/04/03");
                el.Price     = 1500;
                el.Interval  = 4;
                el.To        = "Kipr";
                el.CodePlain = 10;
                Reis.AddElement(el);
            }
        }
        public static void Complete(ref AccessToBasicReis Reis, ref AccessToPlanes Planes)
        {
            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 20;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 40;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 55;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 25;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 40;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 15;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 10;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 25;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }
            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                Planes el = new Entities.Planes();
                el.NumberOfSeats = 30;
                Planes.AddElement(el);
            }

            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 1500;
                el.Interval = 16;
                el.To = "Bangkok";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }

            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 1000;
                el.Interval = 10;
                el.To = "Vladivostok";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 2000;
                el.Interval = 15;
                el.To = "Indonezia";
                el.CodePlain = 3;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 3000;
                el.Interval = 14;
                el.To = "Florida";
                el.CodePlain = 4;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 1000;
                el.Interval = 5;
                el.To = "Minsk";
                el.CodePlain = 5;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 2000;
                el.Interval = 12;
                el.To = "NewYork";
                el.CodePlain = 6;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 4500;
                el.Interval = 10;
                el.To = "Belen";
                el.CodePlain = 7;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 3000;
                el.Interval = 5;
                el.To = "Natal";
                el.CodePlain = 1;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 1500;
                el.Interval = 8;
                el.To = "Terezina";
                el.CodePlain = 9;
                Reis.AddElement(el);
            }
            {
                BasicReis el = new Entities.BasicReis();
                el.Date = DateTime.Parse("2010/04/03");
                el.Price = 1500;
                el.Interval = 4;
                el.To = "Kipr";
                el.CodePlain = 10;
                Reis.AddElement(el);
            }
        }