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