Ejemplo n.º 1
0
        public void GetVisitList_ReturnsExpectedListOfVisitEntities()
        {
            using (var vc = new VisitContext())
            {
                var firstCount = vc.GetVisitList().Count;

                for (var i = 1; i < 4; ++i)
                {
                    vc.CreateVisit(new Visit
                    {
                        VisitDate    = DateTime.Now.AddDays(-i),
                        Appointment  = Convert.ToSByte(true),
                        ArrivingTime = DateTime.Now.TimeOfDay,
                        User         = (from v in vc.DataContext.Users where v.Id == 1 select v).First(),
                        Doctor       = (from d in vc.DataContext.Doctors where d.User.Id == 1 select d).First()
                    });
                }

                var visits = vc.GetVisitList();

                Assert.IsTrue(firstCount != 0);
                Assert.IsTrue(visits.Count == firstCount + 3);
            }
        }