public void TestMethod1() { TravelFacade travel = new TravelFacade(); List <object> results = new List <object>(); DateTime from = DateTime.Now; DateTime to = from.AddDays(3); results = travel.getFlightsAndHotels(from, to); // test the stub if it is making flights and hotels data Assert.AreEqual(true, results.Count > 0); // Check if the results is list of hotels Assert.IsInstanceOfType(results[0], typeof(List <Hotel>)); // Check if the resutls is list of flights Assert.IsInstanceOfType(results[1], typeof(List <Flight>)); }
private static TravelFacade Facade() { var suggestions = new[] { new Suggestion() }; var task = Task.FromResult(suggestions.AsEnumerable()); var regionsServiceMock = new Mock <IRegions>(); regionsServiceMock.Setup(p => p.SuggestionsAsync(It.IsAny <string[]>(), 1033, It.IsAny <CancellationToken>())) .Returns(task); var accommodationsServiceMock = new Mock <IAccommodations>(); accommodationsServiceMock .Setup(p => p.SuggestionsAsync(It.IsAny <string[]>(), 1033, It.IsAny <CancellationToken>())) .Returns(task); var facade = new TravelFacade(regionsServiceMock.Object, accommodationsServiceMock.Object); return(facade); }