public FormStart(string domainName) { InitializeComponent(); _domainName = domainName; domainNameButton.Text = domainName; quizz = new ConcreteQuizzFactory(); _correctAnswer = showQuizz(i); //trebuie sa trecem la urmatoarea intrebare i++; }
public void QuizzFactory_GenerateBasicQuizz_RetourneListeDeQuestions(int nb) { // Arrange var quizz = new QuizzFactory(); // Act var questions = quizz.GenerateBasicQuizz(nb); // Assert Assert.AreEqual(nb, questions.Count()); }
public void QuizzFactory_GenerateQuizz_RetourneRightLevelQuizz(Level lvl) { // Arrange var levelProvider = Mock.Of <ILevelProvider>(); Mock.Get(levelProvider).Setup(m => m.GetLevel()).Returns(lvl); var quizz = new QuizzFactory(levelProvider); // Act var newQuizz = quizz.GenerateQuizz(15); // Assert Assert.AreEqual(lvl, newQuizz.AverageLevel); }
public void QuizzFactory_GenerateEasyQuizz_RetourneEasyLevel() { // Arrange //1. Créer un objet de type ILevelProvider var levelProvider = Mock.Of <ILevelProvider>(); //2. Lui donner le comportement et retour souhaité Mock.Get(levelProvider).Setup(m => m.GetLevel()).Returns(Level.Easy); var quizz = new QuizzFactory(levelProvider); // Act var newQuizz = quizz.GenerateQuizz(15); // Assert Assert.AreEqual(Level.Easy, newQuizz.AverageLevel); }
public FormStart(string domainName) { InitializeComponent(); _domainName = domainName; domainNameButton.Text = domainName; try { quizz = new ConcreteQuizzFactory(); _correctAnswer = showQuizz(i); } catch (OutOfMemoryException) { Console.WriteLine(" Error at create ConcreteQuizzFactory"); } //trebuie sa trecem la urmatoarea intrebare i++; }