コード例 #1
0
        public void Get_Zero_Items()
        {
            TestHelpers.SetupDbSet(this.mockSet, new List <athlete>());

            AthletesController controller = new AthletesController(this.mockContext.Object);

            IQueryable <athlete> athlete = controller.GetAthletes();

            Assert.IsNotNull(athlete);
            Assert.AreEqual(0, athlete.Count());
        }
コード例 #2
0
        public void Get_Should_Return_Items()
        {
            TestHelpers.SetupDbSet(this.mockSet, this.data);

            AthletesController controller = new AthletesController(this.mockContext.Object);

            IQueryable <athlete> athlete = controller.GetAthletes();

            Assert.IsNotNull(athlete);
            Assert.AreNotEqual(0, athlete.Count());
        }