public void CanGetRetroFamily() { //Arrange IRetroRespectiveRepository repo = _mockRetrospectiveRepo.Object; var controller = new RetroFamiliesController(repo, _hubContext.Object); IList <RetroFamily> retroFamilies = new List <RetroFamily>(); RetroFamily f = new RetroFamily { Content = "Okay", Id = 0, Position = 0, }; retroFamilies.Add(f); _mockRetrospectiveRepo.Setup(r => r.RetroFamilies).Returns(retroFamilies.AsQueryable()); //Act RetroFamily family = controller.Get(0).Value; //Assert Assert.NotNull(family); Assert.Equal("Okay", family.Content); Assert.Equal(0, family.Position); }
public async void CanGetAllRetroFamilies() { //Arrange IRetroRespectiveRepository repo = _mockRetrospectiveRepo.Object; var controller = new RetroFamiliesController(repo, _hubContext.Object); IList <RetroFamily> retroFamilies = new List <RetroFamily>(); { RetroFamily f = new RetroFamily { Content = "Okay", Id = 0, Position = 0, }; retroFamilies.Add(f); } { RetroFamily f = new RetroFamily { Content = "Okay2", Id = 1, Position = 1, }; retroFamilies.Add(f); } _mockRetrospectiveRepo.Setup(r => r.RetroFamilies).Returns(retroFamilies.AsQueryable()); //Act var entries = await controller.Get(); //Arrange var test = entries.Value; Assert.Equal(2, test.Count()); }