Ejemplo n.º 1
0
        public async Task GetAdminTypes_ReturnsOkObjectResult()
        {
            // Arrange
            _regionAdministrationService.Setup(x => x.GetAllAdminTypes()).ReturnsAsync(new List <AdminTypeDTO>());
            // Act
            var result = await _regionController.GetAdminTypes();

            var actual = (result as ObjectResult).Value;

            // Assert
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.IsInstanceOf <IEnumerable <AdminTypeDTO> >(actual);
        }
        public async Task GetAdminTypes_ReturnsOkObjectResult()
        {
            // Arrange
            var list = new List <AdminTypeDTO>()
            {
                new AdminTypeDTO()
            };

            _regionAdministrationService.Setup(x => x.GetAllAdminTypes())
            .ReturnsAsync(list);
            // Act
            var result = await _regionController.GetAdminTypes();

            var actual = ((IEnumerable <AdminTypeDTO>)(result as ObjectResult).Value);

            // Assert
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.AreEqual(actual, list);
        }