/// <summary> /// Gets the standings for a specified season and conference /// </summary> /// <param name="seasonID">The ID of the selected season</param> /// <param name="conferenceName">The name of the selected conference</param> /// <returns>The result of the stored procedure execution</returns> public ObjectResult <GetSeasonStandingsForConference_Result> GetSeasonStandingsForConference(int?seasonID, string conferenceName) { try { return(_dbContext.GetSeasonStandingsForConference(seasonID, conferenceName)); } catch (Exception ex) { _log.Error(ex.Message); throw; } }
public static void SetUpFakeSeasonStandingsForConference(this ProFootballEntities dbContext, IEnumerable <GetSeasonStandingsForConference_Result> seasonStandingsEnumerable = null) { if (seasonStandingsEnumerable == null) { seasonStandingsEnumerable = new List <GetSeasonStandingsForConference_Result>(); } var seasonStandingsQueryable = seasonStandingsEnumerable.AsQueryable(); var fakeObjectResult = A.Fake <ObjectResult <GetSeasonStandingsForConference_Result> >(d => d.Implements(typeof(IEnumerable <GetSeasonStandingsForConference_Result>))); // Setup all IEnumerable methods using what you have from "seasonStandings" A.CallTo( () => (fakeObjectResult as IEnumerable <GetSeasonStandingsForConference_Result>).GetEnumerator()) .Returns(seasonStandingsQueryable.GetEnumerator()); // Do the wiring between DbContext and ObjectResult A.CallTo(() => dbContext.GetSeasonStandingsForConference(A <int> .Ignored, A <string> .Ignored)) .Returns(fakeObjectResult); }