Exemplo n.º 1
0
        public void GetAthletesTest()
        {
            TestUtils.AddAthleteToContext(context);
            var result = controller.GetAthletes(string.Empty);

            Assert.AreEqual(1, result.Value.Count);
        }
Exemplo n.º 2
0
        public void GetAthleteTest()
        {
            var athlete = TestUtils.AddAthleteToContext(context);
            var result  = controller.GetAthlete(context.athletes.First().id);

            Assert.AreEqual(athlete.name, result.Value.name);
        }
Exemplo n.º 3
0
        public void RemoveAthleteTest()
        {
            TestUtils.AddAthleteToContext(context);
            var result = controller.RemoveAthlete(context.athletes.First().id);

            Assert.AreEqual(0, context.athletes.Count());
            Assert.AreEqual(200, ((StatusCodeResult)result).StatusCode);
        }
Exemplo n.º 4
0
        public void UpdateAthleteTest()
        {
            var athlete = TestUtils.AddAthleteToContext(context);

            athlete.fullname = "test athlete";
            var result = controller.UpdateAthlete(athlete);

            Assert.AreEqual(athlete.fullname, context.athletes.First().fullname);
            Assert.AreEqual(200, ((StatusCodeResult)result).StatusCode);
        }