Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
private void SetMockTeams() { MockTeams = new Mock <DbSet <Team> >().SetupData(TeamData.Data()); MockTeams.Setup(x => x.Find(It.IsAny <object[]>())).Returns <object[]>(ids => TeamData.Data().FirstOrDefault(d => d.TeamId == (int)ids[0])); MockTeams.Setup(x => x.FindAsync(It.IsAny <object[]>())).Returns <object[]>(ids => Task.FromResult(TeamData.Data().FirstOrDefault(d => d.TeamId == (int)ids[0]))); MockContext.Setup(x => x.Teams).Returns(MockTeams.Object); }