Ejemplo n.º 1
0
        public static void AddNewTraiders(BussinesService bussinesService)
        {
            IDataContex dataContext  = bussinesService.GetDataContex();
            Traider     existTraider = dataContext.Traiders.AsEnumerable().LastOrDefault();

            int newID = 0;

            if (existTraider != null)
            {
                newID = existTraider.ID;
            }

            List <Traider> traiders = new List <Traider>()
            {
                new Traider()
                {
                    ID        = ++newID,
                    FirstName = "Black",
                    Surname   = "Whiteson",
                    PhoneNum  = "34872642891"
                },
                new Traider()
                {
                    ID        = ++newID,
                    FirstName = "Red",
                    Surname   = "Greenson",
                    PhoneNum  = "56454"
                },
                new Traider()
                {
                    ID        = ++newID,
                    FirstName = "Homer(Doy!)",
                    Surname   = "Simpson",
                    PhoneNum  = "1241414"
                },
                new Traider()
                {
                    ID        = ++newID,
                    FirstName = "Marge",
                    Surname   = "Simpson",
                    PhoneNum  = "67868313"
                },
                new Traider()
                {
                    ID        = ++newID,
                    FirstName = "Bart(Ay caramba!)",
                    Surname   = "Simpson",
                    PhoneNum  = "231897193"
                }
            };

            foreach (Traider traider in traiders)
            {
                bussinesService.AddNewTraiderWithStarterPack(traider);
            }
        }
Ejemplo n.º 2
0
 public void TryRegisterNewClient()
 {
     bussinesService.AddNewTraiderWithStarterPack(testTraider);
     dataContex.Add(Arg.Any <Traider>());
     dataContex.SaveChanges();
 }