Esempio n. 1
0
        public void TestService_Can_GetNextQuestion()
        {
            //Arrange
            //Constructor args ICareUow uow, TestLogicFactory factory, IQuestionGenerator questionGenerator
            //Method args Test test, Question prevQuestion
            RepositoryFactories factory    = new RepositoryFactories();
            RepositoryProvider  provider   = new RepositoryProvider(factory);
            CareUow             uow        = new CareUow(provider);
            TestLogicFactory    tFactory   = new TestLogicFactory();
            QuestionGenerator   qGenerator = new QuestionGenerator(uow);
            //TestService target = new TestService(uow, tFactory, qGenerator);
            TestService target = new TestService(uow, tFactory);
            Question    q      = new Question();

            q.Id = 1;
            Test t = new Test();

            t.Type = "sysr";
            t.Id   = 1;

            //Act
            Question next = target.GetNextQuestion(t, q);


            //Assert
            Assert.IsNotNull(next);
            Assert.AreEqual(next.Id, 2);
        }
Esempio n. 2
0
        public void TestService_Can_GetStudent()
        {
            //Arrange
            //Constructor args ICareUow uow, TestLogicFactory factory, IQuestionGenerator questionGenerator
            //method int? studentId
            RepositoryFactories factory  = new RepositoryFactories();
            RepositoryProvider  provider = new RepositoryProvider(factory);
            CareUow             uow      = new CareUow(provider);
            TestLogicFactory    tFactory = new TestLogicFactory();
            //QuestionGenerator qGenerator = new QuestionGenerator(uow);
            TestService target    = new TestService(uow, tFactory);
            int         studentId = 1;

            //Act
            Student student = target.GetStudent(studentId);

            //Assert
            Assert.AreEqual(student.Id, studentId);
        }
Esempio n. 3
0
        public void TestService_Can_Construct()
        {
            //Arrange
            //Constructor args ICareUow uow, TestLogicFactory factory, IQuestionGenerator questionGenerator

            RepositoryFactories factory    = new RepositoryFactories();
            RepositoryProvider  provider   = new RepositoryProvider(factory);
            CareUow             uow        = new CareUow(provider);
            TestLogicFactory    tFactory   = new TestLogicFactory();
            QuestionGenerator   qGenerator = new QuestionGenerator(uow);


            //Act
            //TestService target = new TestService(uow, tFactory, qGenerator);
            TestService target = new TestService(uow, tFactory);

            //Assert
            Assert.IsNotNull(target);
        }