Ejemplo n.º 1
0
        public void test_repository_umocking()
        {
            var objDoctors = new List<Doctor>
            {
                new Doctor {Id = 1, Name = "XXX"},
                new Doctor {Id = 2, Name = "XYZ"}
            };
            var mockDoctorRepository = new Mock<IDoctorRepository>();
            mockDoctorRepository.Setup(i => i.Get()).Returns(objDoctors);

            var repositoryTest = new DoctorRepositorySetup(mockDoctorRepository.Object);
            var doctors = repositoryTest.GetDoctors();
            Assert.IsTrue(doctors.Equals(objDoctors));
        }
Ejemplo n.º 2
0
 public void test_repository_usage()
 {
     var repositoryTest = new DoctorRepositorySetup();
     var doctors = repositoryTest.GetDoctors();
     Assert.IsTrue(doctors!=null);
 }