public void Get_ThrowsException_ForUnknownId()
        {
            Hobbit nullHobbit = null;
            Mock<IDataManager<Hobbit>> mockHobbitManager = new Mock<IDataManager<Hobbit>>();
            mockHobbitManager.Setup(m => m.TryGet(ID, out nullHobbit)).Returns(false);

            HobbitController controller = new HobbitController(mockHobbitManager.Object);

            Assert.Throws<HttpResponseException>(() => controller.Get(ID));
        }
        public void Get_ReturnsSingleHobbit()
        {
            Mock<IDataManager<Hobbit>> mockHobbitManager = new Mock<IDataManager<Hobbit>>();
            mockHobbitManager.Setup(m => m.TryGet(ID, out _testHobbit)).Returns(true);

            HobbitController controller = new HobbitController(mockHobbitManager.Object);

            Hobbit hobbit = controller.Get(ID);

            Assert.Equal(_testHobbit.Name, hobbit.Name);
        }
        public void Get_ReturnsAllHobbits()
        {
            Hobbit[] _singleHobbitArray = new Hobbit[] { _testHobbit };

            Mock<IDataManager<Hobbit>> mockHobbitManager = new Mock<IDataManager<Hobbit>>();
            mockHobbitManager.Setup(m => m.GetAll()).Returns(_singleHobbitArray);

            HobbitController controller = new HobbitController(mockHobbitManager.Object);

            IEnumerable<Hobbit> hobbit = controller.Get();

            Assert.Equal(_singleHobbitArray.Count(), hobbit.Count());
            Assert.Equal(NAME, hobbit.First().Name);
        }