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); }
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); }
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); }