Пример #1
0
        public void Test_GetAll()
        {
            var shelters = new List <Shelter.Shared.Shelter>();

            _mockedDataAccess.Setup(x => x.GetAllShelters()).Returns(shelters);

            var result = _controller.GetAllShelters();

            Assert.IsInstanceOf(typeof(OkObjectResult), result);
            Assert.AreEqual(((OkObjectResult)result).Value, shelters);
        }
Пример #2
0
        public void Test_GetAllShelters()
        {
            var shelters = new List <Shelter.Shared.Shelters>();

            _mockedDataAccess.Setup(x => x.GetAllShelters()).Returns(shelters);
            var result = _controller.GetAllShelters();

            // uncomment this obviously wrong line, see what happens
            // Assert.IsInstanceOf(typeof(NotFoundResult), result);
            Assert.IsInstanceOf(typeof(OkObjectResult), result);
            Assert.AreEqual(((OkObjectResult)result).Value, shelters);
        }