Esempio n. 1
0
        public void GetDistrictsReturnsListOfDistricts()
        {
            //Arrange
            var moq = new Mock <IRegionsRepository>();

            moq.Setup(m => m.GetDistricts(It.IsAny <int>())).Returns(Task.FromResult(new List <District>() as IEnumerable <District>));
            RegionsController controller = new RegionsController(moq.Object);

            //Act
            var result = controller.GetDistricts(3).Result;

            //Arrange
            Assert.IsInstanceOfType(result, typeof(IEnumerable <District>));
        }