Ejemplo n.º 1
1
        private void SetUpGenericRepositoryStub()
        {
            _genericRepository = Substitute.For<IGenericRepository>();
            _summer2010 = new Web.Data.Entities.Session
            {
                SessionName = "Summer 2010",
                BeginDate = new DateTime(2010, 6, 1),
                EndDate = new DateTime(2010, 8, 30)
            };

            _fall2010 = new Web.Data.Entities.Session
            {
                SessionName = "Fall 2010",
                BeginDate = new DateTime(2010, 10, 1),
                EndDate = new DateTime(2011, 1, 3)
            };
            _spring2010 = new Web.Data.Entities.Session
            {
                SessionName = "Spring 2010",
                BeginDate = new DateTime(2010, 01, 1),
                EndDate = new DateTime(2010, 5, 01)
            };

            IEnumerable<Web.Data.Entities.Session> sessionList = new List<Web.Data.Entities.Session>
            {
                _summer2010,
                _fall2010,
                _spring2010
            };

            _genericRepository.GetAll<Web.Data.Entities.Session>().Returns(sessionList);
        }
Ejemplo n.º 2
0
        private void SetUpGenericRepositoryStub()
        {
            _genericRepository = Substitute.For <IGenericRepository>();
            _summer2010        = new Web.Data.Entities.Session
            {
                SessionName = "Summer 2010",
                BeginDate   = new DateTime(2010, 6, 1),
                EndDate     = new DateTime(2010, 8, 30)
            };

            _fall2010 = new Web.Data.Entities.Session
            {
                SessionName = "Fall 2010",
                BeginDate   = new DateTime(2010, 10, 1),
                EndDate     = new DateTime(2011, 1, 3)
            };
            _spring2010 = new Web.Data.Entities.Session
            {
                SessionName = "Spring 2010",
                BeginDate   = new DateTime(2010, 01, 1),
                EndDate     = new DateTime(2010, 5, 01)
            };

            IEnumerable <Web.Data.Entities.Session> sessionList = new List <Web.Data.Entities.Session>
            {
                _summer2010,
                _fall2010,
                _spring2010
            };

            _genericRepository.GetAll <Web.Data.Entities.Session>().Returns(sessionList);
        }
Ejemplo n.º 3
0
        private void Setup()
        {
            _schoolRepository = Substitute.For <ISchoolRepository>();
            _schoolRepository.GetSchool().Returns(new School
            {
                SchoolId = Constants.SchoolId,
                EducationOrganization = new EducationOrganization {
                    EducationOrganizationId = 1
                }
            });

            _session = new SessionBuilder().Build();

            _genericRepository = Substitute.For <IGenericRepository>();
            _genericRepository.Get(Arg.Any <Expression <Func <Web.Data.Entities.Session, bool> > >()).Returns(_session);
        }
        private void Setup()
        {
            _schoolRepository = Substitute.For<ISchoolRepository>();
            _schoolRepository.GetSchool().Returns(new School
            {
                SchoolId = Constants.SchoolId,
                EducationOrganization = new EducationOrganization {EducationOrganizationId = 1}
            });

            _session = new SessionBuilder().Build();

            _genericRepository = Substitute.For<IGenericRepository>();
            _genericRepository.Get(Arg.Any<Expression<Func<Web.Data.Entities.Session, bool>>>()).Returns(_session);


        }
 public ParentCourseGradeBuilder WithSession(Web.Data.Entities.Session session)
 {
     _session = session;
     return this;
 }
Ejemplo n.º 6
0
 public ParentCourseGradeBuilder WithSession(Web.Data.Entities.Session session)
 {
     _session = session;
     return(this);
 }