public void GetReturnsListOfDoctors()
        {
            //Arrange
            repository.Setup(r => r.Get()).ReturnsAsync(new List <Doctor>() as IEnumerable <Doctor>);

            //Act
            var result = controller.Get().Result;

            //Assert
            Assert.IsInstanceOfType(result, typeof(IEnumerable <Doctor>));
        }
        public void Should_ReturnDoctor_When_Get()
        {
            var result = _doctorsController.Get(1);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Id);
        }
Beispiel #3
0
        public void GetDetailsTest()
        {
            var res = new Mock <DoctorRep>(db);
            DoctorsController obj = new DoctorsController(res.Object);
            var data     = obj.Get();
            var okResult = data as OkObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }
Beispiel #4
0
        public void GetAllLearnersPassTest()
        {
            // Act
            var okResult = _doctorControl.Get().Result as OkObjectResult;

            // Assert
            var items = Assert.IsType <List <Doctor> >(okResult.Value);

            Assert.Equal(3, items.Count);
        }