Exemple #1
0
        public void ControllerSuccessTest()
        {
            List <AuditBenchmark.Models.AuditBenchmark> list = new List <AuditBenchmark.Models.AuditBenchmark> {
                new AuditBenchmark.Models.AuditBenchmark()
                {
                    AuditType = "Internal", BenchmarkNoAnswers = 3
                }
            };

            _pro.Setup(x => x.GetAll()).Returns(list);
            var result = _controllerObj.Get() as ObjectResult;

            Assert.AreEqual(200, result.StatusCode);
        }
        public void ControllerTest()
        {
            Mock <IBenchmarkProvider> mock = new Mock <IBenchmarkProvider>();

            mock.Setup(p => p.GetBenchmark()).Returns(ls);
            AuditBenchmarkController cp     = new AuditBenchmarkController(mock.Object);
            OkObjectResult           result = cp.Get() as OkObjectResult;

            Assert.AreEqual(200, result.StatusCode);
        }
        public void Test1()
        {
            BenchmarkRepo obj1 = new BenchmarkRepo();

            BenchmarkProvider bp = new BenchmarkProvider(obj1);

            AuditBenchmarkController obj = new AuditBenchmarkController(bp);

            var data = obj.Get() as OkObjectResult;

            Assert.AreEqual(200, data.StatusCode);
        }