Exemple #1
0
        public void QuestionsProvider_ValidInput_OkRequest(string type)
        {
            Mock <IChecklistRepo> mock = new Mock <IChecklistRepo>();

            mock.Setup(p => p.GetQuestions(type)).Returns(l1);
            ChecklistRepo    cp     = new ChecklistRepo();
            List <Questions> result = cp.GetQuestions(type);

            Assert.AreEqual(l1.Count, result.Count);
        }
Exemple #2
0
 public void GetQuestions_InvalidInput_ReturnBadRequest(string a)
 {
     try
     {
         string type = null;
         Mock <IChecklistRepo> mock = new Mock <IChecklistRepo>();
         mock.Setup(p => p.GetQuestions(type)).Returns(l2);
         ChecklistRepo    cp     = new ChecklistRepo();
         List <Questions> result = cp.GetQuestions(type);
         Assert.AreEqual(l2.Count, result.Count);
     }
     catch (Exception e)
     {
         Assert.AreEqual("Object reference not set to an instance of an object.", e.Message);
     }
 }
Exemple #3
0
 public ChecklistProvider(IConfiguration _config)
 {
     _log4net      = log4net.LogManager.GetLogger(typeof(ChecklistProvider));
     config        = _config;
     checklistRepo = new ChecklistRepo(config);
 }