public void Join_UnapprovedAchievement_Fails() { Mock <IDatabaseContext> fakeContext = new Mock <IDatabaseContext>(); SeasonAchievementManagement mangement = Resolve(fakeContext, true); fakeContext.Setup(x => x.List <Achievement>()).Returns(new Achievement[] { new Achievement { Id = 1, IsApproved = false } }.AsQueryable()); fakeContext.Setup(x => x.List <Season>()).Returns(new Season[] { new Season { Id = 1 } }.AsQueryable()); mangement.Join(1, 1); }
public void Join_NonExistingSeason_Fails() { Mock <IDatabaseContext> fakeContext = new Mock <IDatabaseContext>(); SeasonAchievementManagement mangement = Resolve(fakeContext, true); fakeContext.Setup(x => x.List <Achievement>()).Returns(new Achievement[] { new Achievement { Id = 1 } }.AsQueryable()); fakeContext.Setup(x => x.List <Season>()).Returns(new Season[] { new Season { Id = 1 } }.AsQueryable()); mangement.Join(1, -1); }